Skip to content

Commit

Permalink
Move system tests to a separate directory (#822)
Browse files Browse the repository at this point in the history
* tests moved

* fix the lint settings to take the new dir into account

* docs snippet
  • Loading branch information
stan-dot authored Oct 8, 2024
1 parent f2e63c2 commit 49fd0a5
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/how-to/write-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Writing Tests in This Python Project

Testing is essential to maintain the integrity and reliability of the codebase. Follow the guidelines below to write tests for this project effectively.

## Test Organization

- **Unit Tests**: Place unit tests for individual components in the `tests` directory, but take care to mirror the file structure of the `src` folder with the corresponding code files. Use the `test_*.py` naming convention for test files.
- **System Tests**: Tests that interact with DLS infrastructure, network, and filesystem should be placed in the top-level `systems_test` folder. This separation ensures that these tests are easily identifiable and can be run independently from unit tests.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ filterwarnings = [
"ignore::DeprecationWarning:wheel",
]
# Doctest python code in docs, python code in src docstrings, test functions in tests
testpaths = "docs src tests"
testpaths = "docs src tests system_tests"

[tool.coverage.report]
exclude_also = [
Expand Down Expand Up @@ -176,3 +176,4 @@ lint.select = [
# See https://github.com/DiamondLightSource/python-copier-template/issues/154
# Remove this line to forbid private member access in tests
"tests/**/*" = ["SLF001"]
"system_tests/**/*" = ["SLF001"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 49fd0a5

Please sign in to comment.