-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for python scripts in _includes
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: test-python-scripts | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test-python-scripts: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
auto-activate-base: true | ||
activate-environment: "" | ||
channel-priority: strict | ||
miniforge-variant: Miniforge | ||
- name: install common conda dependencies | ||
run: conda install -c conda-forge -c euro-bioimaging python=3.10 napari=0.4.17 pytest notebook matplotlib jupytext "scikit-image>=0.20" openijtiff -y | ||
- name: linux test | ||
if: matrix.os == 'ubuntu-latest' | ||
shell: bash -l {0} | ||
run: pytest test_python | ||
- name: osx test | ||
if: matrix.os == 'macos-latest' | ||
shell: bash -l {0} | ||
run: pytest pytest test_python | ||
- name: windows test | ||
if: matrix.os == 'windows-latest' | ||
shell: cmd /C CALL {0} | ||
run: pytest pytest test_python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pathlib | ||
import runpy | ||
import pytest | ||
|
||
scripts = map(str, (pathlib.Path(__file__).parent / '..'/ '_includes').resolve().glob('**/*.py')) | ||
|
||
|
||
@pytest.mark.parametrize('script', scripts) | ||
def test_script_execution(script): | ||
runpy.run_path(script) |