Syntax error in test file makes pytest exit with exit code 2 #4603
Labels
topic: config
related to config handling, argument parsing and config file
type: enhancement
new feature or API change, should be merged into features branch
Ubuntu 18.04
pytest-4.0.2
python 2.7 and 3.6
Description
Having a test file with syntax error or import error results in pytest exiting with exitcode 2.
How to reproduce
test_syntax_error.py
with contentpytest test_syntax_error.py; echo $?
Expected
Probably worth a new exitcode as it doesn't really fit into those 5 documented
Actual
Exits with code 2, which stands for "Test execution was interrupted by the user"
Similarly, a file with content
import non_existent
will have the same effect.This issue is similar to #2832 and also
#2950, but still I hope this will be useful for reference and example.
The text was updated successfully, but these errors were encountered: