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

Handle xfail(strict=True) properly in --step-wise mode #5555

Merged
merged 1 commit into from
Jul 4, 2019

Conversation

nicoddemus
Copy link
Member

Fix #5547

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

That was easy!

@asottile asottile added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Jul 4, 2019
@codecov
Copy link

codecov bot commented Jul 4, 2019

Codecov Report

Merging #5555 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5555      +/-   ##
==========================================
- Coverage   96.11%   96.09%   -0.03%     
==========================================
  Files         117      117              
  Lines       25701    25713      +12     
  Branches     2493     2493              
==========================================
+ Hits        24702    24708       +6     
- Misses        695      701       +6     
  Partials      304      304
Impacted Files Coverage Δ
src/_pytest/stepwise.py 96.55% <100%> (ø) ⬆️
testing/test_stepwise.py 100% <100%> (ø) ⬆️
src/_pytest/doctest.py 94.38% <0%> (-2.25%) ⬇️

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 95824c5...8651d88. Read the comment docs.


# because we are writing to the same file, mtime might not be affected enough to
# invalidate the cache, making this next run flaky
testdir.tmpdir.join("__pycache__").remove()
Copy link
Member Author

Choose a reason for hiding this comment

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

argh!

Should we remove all __pycache__ directories from testdir.tmpdir before each testdir.runpytest call?

Copy link
Member

Choose a reason for hiding this comment

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

ufff that's pretty unfortunate. Probably not though, the assert rewrite tests I think need that

Another idea would be to use utime to force the issue in another way

Copy link
Member Author

Choose a reason for hiding this comment

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

Well in that case it doesn't really matter, so let's stick with just removing the __pycache__ for now.

@nicoddemus
Copy link
Member Author

I'll handle the backport 👍

@nicoddemus nicoddemus merged commit b1928f8 into pytest-dev:master Jul 4, 2019
@nicoddemus nicoddemus deleted the sw-xfail-5547 branch July 4, 2019 23:51
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Jul 4, 2019
Handle xfail(strict=True) properly in --step-wise mode
@nicoddemus nicoddemus added backported and removed needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch labels Jul 4, 2019
@asottile
Copy link
Member

asottile commented Jul 5, 2019

grats on quads

@nicoddemus
Copy link
Member Author

🎉

nicoddemus added a commit that referenced this pull request Jul 5, 2019
[4.6] Handle xfail(strict=True) properly in --step-wise mode (#5555)
@@ -72,7 +72,7 @@ def pytest_collection_modifyitems(self, session, config, items):

def pytest_runtest_logreport(self, report):
# Skip this hook if plugin is not active or the test is xfailed.
Copy link
Member

Choose a reason for hiding this comment

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

This comment seems wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

oops indeed

Copy link
Member Author

Choose a reason for hiding this comment

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

nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Jul 5, 2019
nicoddemus added a commit that referenced this pull request Jul 5, 2019
Fix comment in stepwise (follow up to #5555) [skip ci]
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Jul 5, 2019
nicoddemus added a commit that referenced this pull request Jul 5, 2019
[4.6] Fix comment in stepwise (follow up to #5555) [skip ci] (#5560)
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.

pytest stepwise doesn't work with xfail strict failures
3 participants