Skip to content

Commit 71acb04

Browse files
cclausspeterbarker
authored andcommitted
tests: README.md caution about pytest run in GitHub Actions
1 parent 8d84605 commit 71acb04

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
> [!CAUTION]
2+
> `pytest tests/` will be run in GitHub Actions.
3+
4+
All Python files in this directory that meet [pytest discovery rules](https://docs.pytest.org/en/stable/explanation/goodpractices.html#conventions-for-python-test-discovery) will be examined by pytest and all tests that it finds will be run.
5+
6+
Files of the form `test_*.py` or `*_test.py` should avoid code at global scope because it will be executed in pytest's discovery process. Classes, functions, and code in `if __name__ == "__main__":` blocks will not be run in this discovery process, but code at global scope (including imports) will.

0 commit comments

Comments
 (0)