Skip to content

Commit 7ae2e35

Browse files
Improve troubleshooting information of python testing exercise (#256)
* Improve troubleshooting information Added troubleshooting tips for pytest module location issues. * remove trailing space
1 parent bdaabbc commit 7ae2e35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

05_testing_and_ci/python_testing_exercise.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
- Now call the function `initialize_domain` with the chosen values of `w`, `h`, `dx`, and `dy` and using an assertion statement, check if the values of `nx` and `ny` in the class member variables are equal to your expected values.
4545
- Note that you have the object of the class `SolveDiffusion2D` and hence you can access member variables, for example `solver.nx` and `solver.ny`. This is useful to check the actual values.
4646
- Using a similar workflow, complete the other two unit tests.
47-
- Sometimes pytest is not able to find the tests. One reason is the way pytest is installed, which is typically either using pip or apt. Refer to the [corresponding section](https://github.com/Simulation-Software-Engineering/Lecture-Material/blob/main/05_testing_and_ci/python_testing_demo.md#pytest) in the demo for more details. If such errors occur, then try to explicitly point pytest to the relevant test file in the following way:
47+
- **Troubleshooting:**
48+
- If pytest is not able to locate the `diffusion2d` module, try `python3 -m pytest` instead to add the current directory to `sys.path`, see [documentation](https://docs.pytest.org/en/stable/how-to/usage.html).
49+
- Sometimes pytest is not able to find the tests. One reason is the way pytest is installed, which is typically either using pip or apt. Refer to the [corresponding section](https://github.com/Simulation-Software-Engineering/Lecture-Material/blob/main/05_testing_and_ci/python_testing_demo.md#pytest) in the demo for more details. If such errors occur, then try to explicitly point pytest to the relevant test file in the following way:
4850

4951
```bash
5052
pytest tests/unit/test_diffusion2d_functions.py

0 commit comments

Comments
 (0)