-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Handle os.chdir() during collection #4317
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
Codecov Report
@@ Coverage Diff @@
## features #4317 +/- ##
============================================
+ Coverage 95.84% 95.84% +<.01%
============================================
Files 111 111
Lines 24888 24895 +7
Branches 2427 2427
============================================
+ Hits 23854 23861 +7
Misses 737 737
Partials 297 297
Continue to review full report at Codecov.
|
@@ -847,11 +848,10 @@ def parse(self, args, addopts=True): | |||
args, self.option, namespace=self.option | |||
) | |||
if not args: | |||
cwd = os.getcwd() | |||
if cwd == self.rootdir: | |||
if self.cwd == self.rootdir: |
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.
i just noticed this one - its "incorrect"
if test-paths is relative to the original cwd, then the result is entirely incorrect
its absolutely necessary to trigger a warning there - fundamentally a testsuite that changes the cwd at import time for bits of the suite already is broken and users should rectify that
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.
@RonnyPfannschmidt
Ah.. so this should make testpaths absolute then probably.
I agree that os.chdir
during import etc is bad, but it seemed easy enough to work around / fix this.
Will create a follow-up.
No description provided.