Skip to content

Commit

Permalink
tests: github tests worflow + to_mne and trc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne de Montalivet committed Jan 3, 2024
1 parent 7f91266 commit 5b7dd0f
Show file tree
Hide file tree
Showing 5 changed files with 691 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: tests

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
tests:
runs-on: ${{ matrix.os }}
env:
CONDA_ENV: 'environment.yml'
strategy:
matrix:
python-version: ["3.9", "3.11"]
os: [ubuntu-latest, windows-latest]

name: tests_python-${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: 'mmio'
python-version: ${{ matrix.python-version }}
environment-file: ${{ env.CONDA_ENV }}
- name: Install extra dependencies
shell: bash -el {0}
run: poetry install --with dev
- name: Test with pytest
shell: bash -el {0}
run: |
pytest micromed_io --cov=micromed_io --cov-report=xml --doctest-modules tests/
- name: Upload coverage stats
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml

2 changes: 1 addition & 1 deletion micromed_io/to_mne.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def create_mne_from_micromed_recording(
Examples
--------
>>> from micromed_io.to_mne import create_mne_from_micromed_recording
>>> mne_raw = create_mne_from_micromed_recording("path/to/file.TRC", start_time=10.0, stop_time=20.0)
>>> mne_raw = create_mne_from_micromed_recording("path/to/file.TRC", start_time=10.0, stop_time=20.0) #doctest: +SKIP
"""
micromed_trc = MicromedTRC(recording_file)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ mne = "^1.0.0"
click = "^8.1.7"
pylsl = "^1.16.2"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[tool.poetry.scripts]
mmio_emulate_trc = "micromed_io.scripts.emulate_online_trc:run"
Expand All @@ -25,6 +23,8 @@ sphinx-copybutton = "^0.5.2"
numpydoc = "^1.6.0"
pydata-sphinx-theme = "^0.14.4"
sphinx-gallery = "^0.15.0"
pytest = "^7.4.4"
pytest-cov = "^4.1.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
Loading

0 comments on commit 5b7dd0f

Please sign in to comment.