Skip to content
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
Merged

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

merged 1 commit into from
Jun 21, 2016

Conversation

omarkohl
Copy link
Contributor

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
Copy link
Member

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

@coveralls
Copy link

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
Copy link

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.

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
Copy link

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(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@nicoddemus
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants