Skip to content

Commit

Permalink
ENH: pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Aug 22, 2023
1 parent c4e4125 commit 15d5d0d
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 78 deletions.
16 changes: 16 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[run]
branch = True
source = mne
omit =
*/bin/*
*/setup.py
*/mne/fixes*
*/mne/utils/linalg.py
*/mne/conftest.py

[report]
exclude_lines =
pragma: no cover
if __name__ == .__main__.:
@abstractmethod
@abstractclassmethod
20 changes: 12 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
push:
branches:
Expand All @@ -12,16 +15,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
max-parallel: 5

matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- name: Install Python 3
uses: actions/setup-python@v1
- uses: actions/setup-python@v4
with:
python-version: 3.8.17
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run test.py
run: python -m unittest discover -s ./tests
python -m pip install --upgrade pip setuptools
pip install -r requirements.txt pytest pytest-cov
- run: pytest tests/test.py
- uses: codecov/codecov-action@v3
if: success()
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
**/venv
**/__pycache__
.idea
*.log
*.log
*.egg-info
junit-results.xml
tests/wd
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = """-ra --cov-report= --tb=short \
--junit-xml=junit-results.xml \
--color=yes --capture=sys"""
junit_family = "xunit2"
Loading

0 comments on commit 15d5d0d

Please sign in to comment.