Fix/improve handling of chdir with no-args and testpaths#4336
Fix/improve handling of chdir with no-args and testpaths#4336blueyed merged 1 commit intopytest-dev:featuresfrom
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.
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.
The cast to string was needed for xdist.
There was a problem hiding this comment.
good point, then it is definitively needed for the line below where it sets args = [self.invocation_dir]
Fixes #4332.