|
29 | 29 |
|
30 | 30 | - The process is managed by subclasses of the `MPITestWrapper` base class
|
31 | 31 | - Each test file must contain **exactly one** test function
|
| 32 | + - The test function must be protected with the `@pytest.mark.skipif_incompatible_mpi` |
| 33 | + marker to protect against buggy OpenMPI versions (at least up to 4.1.6; 5.0.7 and |
| 34 | + later are definitely good). |
32 | 35 | - The test function must be decorated with a subclass of `MPITestWrapper`
|
33 | 36 | - The wrapper will write a modified version of the test file as `runner.py`
|
34 | 37 | to a temporary directory and mpirun it from there; results are collected
|
35 | 38 | in the temporary directory
|
36 | 39 | - The test function can be decorated with other pytest decorators. These
|
37 | 40 | are evaluated in the wrapping process
|
38 | 41 | - No decorators are written to the `runner.py` file.
|
39 |
| - - Test files **must not import nest** outside the test function |
| 42 | + - Test files must import all required modules (especially `nest`) inside the |
| 43 | + test function. |
| 44 | + - The docstring for the test function shall in its last line specify what data |
| 45 | + the test function outputs for comparison by the test. |
40 | 46 | - In `runner.py`, the following constants are defined:
|
41 | 47 | - `SPIKE_LABEL`
|
42 | 48 | - `MULTI_LABEL`
|
43 | 49 | - `OTHER_LABEL`
|
44 | 50 | They must be used as `label` for spike recorders and multimeters, respectively,
|
45 | 51 | or for other files for output data (CSV files). They are format strings expecting
|
46 | 52 | the number of processes with which NEST is run as argument.
|
47 |
| -- `conftest.py` must not be loaded, otherwise mpirun will return a non-zero exit code; |
48 |
| - use `pytest --noconftest` |
49 | 53 | - Set `debug=True` on the decorator to see debug output and keep the
|
50 | 54 | temporary directory that has been created (latter works only in
|
51 | 55 | Python 3.12 and later)
|
52 | 56 | - Evaluation criteria are determined by the `MPITestWrapper` subclass
|
53 | 57 |
|
54 |
| -This is still work in progress. |
| 58 | +
|
55 | 59 | """
|
56 | 60 |
|
57 | 61 | import ast
|
|
0 commit comments