-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Remove/replace some unneeded usages of py.path #8440
Conversation
@@ -5,9 +5,9 @@ | |||
pytest_plugins = ("pytester",) | |||
|
|||
|
|||
def test_failure_demo_fails_properly(testdir): | |||
target = testdir.tmpdir.join(os.path.basename(failure_demo)) | |||
def test_failure_demo_fails_properly(pytester): |
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.
as a followup we might want to make this use examples
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.
This one I'm not exactly sure where it's used, so left it as is.
doc/en/example/multipython.py
Outdated
@@ -30,8 +30,8 @@ def __init__(self, version, picklefile): | |||
self.picklefile = picklefile | |||
|
|||
def dumps(self, obj): | |||
dumpfile = self.picklefile.dirpath("dump.py") | |||
dumpfile.write( | |||
dumpfile = self.picklefile.parent / "dump.py" |
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.
lets use Path.with_name
for those cases instead of path.parent / "newname"
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.
Right, changed.
doc/en/reference/unittest.rst
Outdated
tmpdir.chdir() # change to pytest-provided temporary directory | ||
tmpdir.join("samplefile.ini").write("# testdata") | ||
def initdir(self, tmp_path): | ||
os.chdir(tmp_path) # change to pytest-provided temporary directory |
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.
followup consideration: do we want to put monkeypatch.chdir
in here for giving a better example
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.
Good idea, I changed to that.
e34d3f9
to
59251e8
Compare
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.
Lovely
failures is unrelated doc linkage issue cc @evildmp as that's probably going to be part of great loop |
As discussed in #8251 (comment) I am trying to find remaining py.path usages by completely removing it and seeing what breaks. These are the simple cases I found, mostly in the docs and tests. No user-facing changes.