New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit pytest on collection error (without executing tests) #1628

Merged
merged 1 commit into from Jun 21, 2016

Conversation

Projects
None yet
4 participants
@omarkohl
Contributor

omarkohl commented Jun 21, 2016

Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

  • Target: for bug or doc fixes, target master; for new features, target features
  • Make sure to include one or more tests for your change
  • Add yourself to AUTHORS
  • Add a new entry to the CHANGELOG (choose any open position to avoid merge conflicts with other PRs)
@The-Compiler

This comment has been minimized.

Member

The-Compiler commented Jun 21, 2016

LGTM, great work! Let's see how the tests turn out...

@coveralls

This comment has been minimized.

coveralls commented Jun 21, 2016

Coverage Status

Coverage increased (+0.02%) to 92.406% when pulling 778c0cf on omarkohl:exit_on_collection_error into 54872e9 on pytest-dev:features.

@coveralls

This comment has been minimized.

coveralls commented Jun 21, 2016

Coverage Status

Coverage increased (+0.02%) to 92.406% when pulling 778c0cf on omarkohl:exit_on_collection_error into 54872e9 on pytest-dev:features.

Exit pytest on collection error (without executing tests)
Add --continue-on-collection-errors option to restore the previous behaviour:
Execute tests (that were successfully collected) even when collection errors
happen.

Some tests had to be modified e.g. because the return code changed to 2
(EXIT_INTERRUPTED) instead of 1 (EXIT_TESTSFAILED) because an Interrupted
exception is raised on collection error.

Implemented via pair programming with:
    Oleg Pidsadnyi <oleg.pidsadnyi@gmail.com>

closes #1421
@coveralls

This comment has been minimized.

coveralls commented Jun 21, 2016

Coverage Status

Coverage increased (+0.02%) to 92.406% when pulling ede7478 on omarkohl:exit_on_collection_error into 54872e9 on pytest-dev:features.

@@ -642,3 +642,114 @@ def test___repr__():
""")
reprec = testdir.inline_run("-k repr")
reprec.assertoutcome(passed=1, failed=0)
COLLECTION_ERROR_PY_FILES = dict(

This comment has been minimized.

@nicoddemus

nicoddemus Jun 21, 2016

Member

Just a tip: sometimes these type of metadata is better put into a session fixture. 😉

@nicoddemus

This comment has been minimized.

Member

nicoddemus commented Jun 21, 2016

Tested it on my windows laptop since AppVeyor is stuck (py27,py35,linting).

@nicoddemus nicoddemus merged commit 2305d32 into pytest-dev:features Jun 21, 2016

1 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment