Skip to content

Bugfix/warningschecker twice#4620

Merged
blueyed merged 5 commits into
pytest-dev:masterfrom
Sup3rGeo:bugfix/warningschecker-twice
Jan 9, 2019
Merged

Bugfix/warningschecker twice#4620
blueyed merged 5 commits into
pytest-dev:masterfrom
Sup3rGeo:bugfix/warningschecker-twice

Conversation

@Sup3rGeo

@Sup3rGeo Sup3rGeo commented Jan 9, 2019

Copy link
Copy Markdown
Member

Fixes #4617

  • Create a new changelog file in the changelog folder, with a name like <ISSUE NUMBER>.<TYPE>.rst. See changelog/README.rst for details.
  • Target the master branch for bug fixes, documentation updates and trivial changes.
  • Include new tests or update existing tests when applicable.

@codecov

codecov Bot commented Jan 9, 2019

Copy link
Copy Markdown

Codecov Report

Merging #4620 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4620      +/-   ##
==========================================
- Coverage   95.75%   95.75%   -0.01%     
==========================================
  Files         111      111              
  Lines       24678    24683       +5     
  Branches     2446     2446              
==========================================
+ Hits        23630    23634       +4     
+ Misses        740      739       -1     
- Partials      308      310       +2
Flag Coverage Δ
#docs 29.57% <20%> (+0.07%) ⬆️
#doctesting 29.57% <20%> (+0.07%) ⬆️
#linting 29.57% <20%> (+0.07%) ⬆️
#linux 95.57% <100%> (-0.01%) ⬇️
#nobyte 92.37% <100%> (ø) ⬆️
#numpy 93.19% <100%> (ø) ⬆️
#pexpect 42.12% <0%> (-0.02%) ⬇️
#py27 93.78% <100%> (-0.02%) ⬇️
#py34 91.86% <100%> (+0.06%) ⬆️
#py35 91.88% <100%> (+0.06%) ⬆️
#py36 91.91% <100%> (+0.07%) ⬆️
#py37 93.93% <100%> (+0.02%) ⬆️
#trial 93.19% <100%> (ø) ⬆️
#windows 93.93% <100%> (+0.01%) ⬆️
#xdist 93.78% <100%> (-0.01%) ⬇️
Impacted Files Coverage Δ
testing/test_warnings.py 98.84% <100%> (+0.02%) ⬆️
src/_pytest/recwarn.py 98.36% <100%> (+0.01%) ⬆️
src/_pytest/cacheprovider.py 95.75% <0%> (-1.42%) ⬇️
src/_pytest/capture.py 94.11% <0%> (+0.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4c426b...7ee03e0. Read the comment docs.

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

approving based on the discussion we had in the issue

@blueyed blueyed merged commit f3b6425 into pytest-dev:master Jan 9, 2019
@blueyed

blueyed commented Jan 9, 2019

Copy link
Copy Markdown
Contributor

Thank you!

Comment thread testing/test_warnings.py
result.stdout.fnmatch_lines(["*1 failed in*"])


def test_warningschecker_twice(testdir):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would go for a simple unittest here:

def test_warningschecker_twice():
    expectation = pytest.warns(UserWarning)
    with expectation:
        warnings.warn("Message A", UserWarning)
    with expectation:
        warnings.warn("Message B", UserWarning)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@nicoddemus
Makes sense, sorry for merging it too early.
Will you create a followup?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, way simpler! But now it should be another PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep, we can't change this one anymore. Can you do it @Sup3rGeo? If you don't have the time, I will get to it later. 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done: #4622

@Sup3rGeo Sup3rGeo deleted the bugfix/warningschecker-twice branch June 1, 2019 16:21
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.

Cannot enter WarningsChecker twice

4 participants