-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
_getconftestmodules: avoid isfile()/dirpath() #4224
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 @@
## master #4224 +/- ##
==========================================
+ Coverage 93.38% 95.86% +2.47%
==========================================
Files 109 109
Lines 24585 24590 +5
Branches 2389 2392 +3
==========================================
+ Hits 22959 23573 +614
+ Misses 1308 721 -587
+ Partials 318 296 -22
Continue to review full report at Codecov.
|
The 2nd commit also uses lru_cache missing in py27. |
1acb18b
to
b46d42d
Compare
I am taking out the 2nd commit (1acb18b). |
@@ -399,7 +399,7 @@ def _getconftestmodules(self, path): | |||
mod = self._importconftest(conftestpath) | |||
clist.append(mod) | |||
|
|||
self._path2confmods[directory] = clist | |||
self._path2confmods[path] = clist |
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.
Note that with 1acb18b I've noticed that some other code might expect a dirpath in self._path2confmods
- haven't checked if I broke this with the previous optimization already though.
b46d42d
to
63691f5
Compare
Ref: #2206 (comment)
I cannot see a real difference myself with clock time (1.2s vs 1.15s with some project and
-k doesnotmatch
), but I think it makes sense anyway, and might help with the above comment.For pytest itself:
new: 1 loop, best of 5: 1.73 sec per loop
old: 1 loop, best of 5: 1.61 sec per loop
However, pytest itself displays "2287 deselected in 1.06 seconds" vs "2287 deselected in 1.22 seconds".