-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix cwd explosion #1593
Fix cwd explosion #1593
Conversation
@@ -925,3 +925,11 @@ def test_repr_traceback_with_unicode(style, encoding): | |||
repr_traceback = formatter.repr_traceback(e_info) | |||
assert repr_traceback is not None | |||
|
|||
@pytest.mark.xfail | |||
def test_cwd_deleted_(tmpdir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use testdir
instead? This way we can be sure the sub-test is actually failing, while the actual test_cwd_deleted
then passes.
Thanks for taking the time to work on this! 😁 |
@@ -925,3 +925,14 @@ def test_repr_traceback_with_unicode(style, encoding): | |||
repr_traceback = formatter.repr_traceback(e_info) | |||
assert repr_traceback is not None | |||
|
|||
|
|||
@pytest.mark.xfail | |||
def test_cwd_deleted_(testdir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for not being clearer, I meant something like this:
def test_cwd_deleted(testdir):
testdir.makepyfile("""
def test(tmpdir):
tmpdir.chdir()
tmpdir.remove()
assert False
""")
result = testdir.runpytest()
result.stdout.fnmatch_lines(['* 1 failed in *'])
assert 'INTERNALERROR' not in result.stdout.str() + result.stderr.str()
This way we make sure that when the test passes we are observing the correct behavior.
Ah okay. Thank you! |
@@ -10,6 +10,9 @@ | |||
|
|||
* | |||
|
|||
* Fix exception visualization in case the current working directory (CWD) gets | |||
deleted during testing. Fixes (`#1235`). Thanks `@bukzor` for reporting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are at it, please add a and
@marscher_ for the PR
. 😁
7c3bbf8
to
cd30f3d
Compare
…s deleted during testing. Fixes pytest-dev#1235.
cd30f3d
to
09d163a
Compare
Now paths are still relative if cwd exists and absolute if it doesn't. Is this really such a huge game changer to target feature? |
I think that'd be fine. If you have a pytest crash, |
I agree, it can't possibly break anything, so in this case I think it is OK to go to Thanks again @marscher for the work and patience! 👍 |
I propose merging to features and doing 2.10 next weekend |
No problem in releasing |
Do you think rebasing will cause a lot of conflicts? If you prefer this
solution I'm happy with reopen this against the feature branch.
Although I would say that a deleted cwd is a very rare case ;o)
btw: Viel Spaß in Freiburg!
|
Agreed |
This contains only a small fix for the bug mentioned in #1235, so it should go to master.