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
- Create a file named
test_syntax_error.py with content
- Run pytest and print exit code
pytest 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.
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.pywith 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_existentwill 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.