Replace pytest.exit with FileNotFoundError so that error is reported properly....
Replace pytest.exit with FileNotFoundError so that error is reported properly. This is because xdist incorrect intercepts a pytest.exit as a keyboard interrupt and removes the error message.
@@ -108,6 +108,10 @@ Commonly used options like `-n auto` are added to addopts within the [pytest] se
The `-v` (or `--verbose`) option is helpful to see what is going on.
If an error occurs that lacks details or if you see a "keyboard interrupt" reported by xdist, try running pytest with `-n 0`. This may provide more accurate details for the source of the error.
Avoid using pytest.exit in the pytest test code, and instead raise an exception. This is because xdist does not capture pytest.exit properly, hiding the error message and reporting a false keyboard interrupt.