1
+ name :
2
+ Test
3
+
4
+ description :
5
+ Run pytest, and run the doctest runner (shapefile.py as a script).
6
+
7
+ inputs :
8
+ python_version :
9
+ required : false
10
+ default : " 3.13"
11
+ description : ' The Python version to run the tests on. '
12
+
13
+
14
+ runs :
15
+ using : " composite"
16
+ steps :
17
+ # The Repo is required to already be checked out, e.g. by the calling workflow
18
+ - uses : LizardByte/setup-python-action@master
19
+ with :
20
+ python-version : ${{ inputs.python_version }}
21
+
22
+ - name : Doctests
23
+ run : python shapefile.py
24
+
25
+ - name : Install test dependencies.
26
+ run : |
27
+ python -m pip install --upgrade pip
28
+ pip install -r requirements.test.txt
29
+
30
+ - name : Pytest
31
+ run : |
32
+ pytest
33
+
34
+ - name : Show versions.
35
+ shell : ${{ inputs.shell }}
36
+ working-directory : ' .\sDNA\sdna_vs2008\tests\pytest'
37
+ run : |
38
+ python --version
39
+ python -c "import numpy; print(numpy.__version__)"
40
+ python -m pytest --version
41
+
42
+
43
+ # - name: Run debug_test.py directly.
44
+ # shell: cmd
45
+ # working-directory: '.\sDNA\sdna_vs2008\tests'
46
+ # # run: python -u debug_test.py
47
+ # run: set "sdnadll=c:\Program Files (x86)\sDNA\x64\sdna_vs2008.dll" & python -u debug_test.py
48
+
49
+ # - name: Run diff test number 0 directly via
50
+ # test_gathering_windows_command_line_tests.py, by test index
51
+ # working-directory: '.\sDNA\sdna_vs2008\tests\pytest'
52
+ # run: python test_gathering_windows_command_line_tests.py 0
53
+
54
+ - name : Run all the diff tests with Pytest.
55
+ shell : ${{ inputs.shell }}
56
+ working-directory : .\sDNA\sdna_vs2008\tests\pytest
57
+ env :
58
+ DONT_TEST_N_LINK_SUBSYSTEMS_ORDER : ${{ inputs.DONT_TEST_N_LINK_SUBSYSTEMS_ORDER }}
59
+ ALLOW_NEGATIVE_FORMULA_ERROR_ON_ANY_LINK_PRESENT : ${{ inputs.ALLOW_NEGATIVE_FORMULA_ERROR_ON_ANY_LINK_PRESENT }}
60
+ sdnadll : ${{ inputs.sdnadll }}
61
+ sdna_bin_dir : ${{ inputs.sdna_bin_dir }}
62
+ sdna_debug : ${{ inputs.sdna_debug }}
63
+ run : pytest -rA
64
+ # -rA shows summary of tests, one per line, even when they all pass.
65
+ #
66
+ # To run the same tests locally, the command is something like:
67
+ # run: >
68
+ # set "sdnadll=c:\Program Files (x86)\sDNA\x64\sdna_vs2008.dll" &
69
+ # set "sdna_bin_dir=c:\Program Files (x86)\sDNA\bin" &
70
+ # set sdna_debug=False &
71
+ # set DONT_TEST_N_LINK_SUBSYSTEMS_ORDER=1 &
72
+ # set ALLOW_NEGATIVE_FORMULA_ERROR_ON_ANY_LINK_PRESENT=1 &
73
+ # pytest -rA
0 commit comments