-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix/improve handling of chdir with no-args and testpaths #4336
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
Conversation
As per https://github.com/pytest-dev/pytest/pull/4317/files#r231699560 there could also be a warning, but that would add an extra |
Codecov Report
@@ Coverage Diff @@
## features #4336 +/- ##
===========================================
- Coverage 95.84% 95.64% -0.2%
===========================================
Files 111 111
Lines 24893 24900 +7
Branches 2431 2428 -3
===========================================
- Hits 23858 23816 -42
- Misses 737 781 +44
- Partials 298 303 +5
Continue to review full report at Codecov.
|
src/_pytest/config/__init__.py
Outdated
args = self.getini("testpaths") | ||
if self.invocation_dir == self.rootdir: | ||
args = [ | ||
str(self.invocation_dir.join(x)) if not os.path.isabs(x) else x |
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.
you can use self.invocation_dir.join(x, abs=True)
and i believe the cast to str is not needed
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.
The cast to string was needed for xdist.
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 point, then it is definitively needed for the line below where it sets args = [self.invocation_dir]
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.
👍
Fixes #4332.