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

Raise CollectError if pytest.skip() is called during collection #1519

Merged
merged 2 commits into from
Jun 25, 2016
Merged

Raise CollectError if pytest.skip() is called during collection #1519

merged 2 commits into from
Jun 25, 2016

Commits on Jun 24, 2016

  1. Raise CollectError if pytest.skip() is called during collection

    pytest.skip() must not be used at module level because it can easily be
    misunderstood and used as a decorator instead of pytest.mark.skip, causing the
    whole module to be skipped instead of just the test being decorated.
    
    This is unexpected for users used to the @unittest.skip decorator and therefore
    it is best to bail out with a clean error when it happens.
    
    The pytest equivalent of @unittest.skip is @pytest.mark.skip .
    
    Adapt existing tests that were actually relying on this behaviour and add a
    test that explicitly test that collection fails.
    
    fix #607
    omarkohl committed Jun 24, 2016
    Configuration menu
    Copy the full SHA
    d81f230 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b3615ac View commit details
    Browse the repository at this point in the history