generated from gma/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If no tests then Pytest should exit with 0 (not 5)
- Add a 'test' target to run pytest against the 'tests' directory. If an exit code of 5 is found then exit with a 0 instead. Otherwise exit with the appropriate error code. - Intercept 'pytest_sessionfinish' to do the same thing in conftest.py [1]. - Switch off 'disallowed_untyped_defs' in mypy.ini as hints should help readability where it makes sense (hence 'hints'). It should not be enforced all the time IMHO. [1] pytest-dev/pytest#2393
- Loading branch information
1 parent
bb71ce0
commit e07d756
Showing
4 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
set -e | ||
|
||
make check | ||
pytest "$@" | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NO_TESTS_COLLECTED = 5 | ||
SUCCESS = 0 | ||
|
||
|
||
def pytest_sessionfinish(session, exitstatus): | ||
if exitstatus == NO_TESTS_COLLECTED and session.config.getoption("-k"): | ||
session.exitstatus = SUCCESS |