-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
A few tiny micro-optimizations/simplifications #7238
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -443,8 +443,7 @@ def pytest_runtest_logstart(self, nodeid, location): | |
self.write_ensure_prefix(line, "") | ||
self.flush() | ||
elif self.showfspath: | ||
fsid = nodeid.split("::")[0] | ||
self.write_fspath_result(fsid, "") | ||
self.write_fspath_result(nodeid, "") | ||
self.flush() | ||
|
||
def pytest_runtest_logreport(self, report: TestReport) -> None: | ||
|
@@ -474,10 +473,7 @@ def pytest_runtest_logreport(self, report: TestReport) -> None: | |
else: | ||
markup = {} | ||
if self.verbosity <= 0: | ||
if not running_xdist and self.showfspath: | ||
self.write_fspath_result(rep.nodeid, letter, **markup) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is never reached? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is reached, but has the same outcome as just the What The reason it's not needed here is that Because the check it performs is mildly expensive, it's good to avoid it when possible. |
||
else: | ||
self._tw.write(letter, **markup) | ||
self._tw.write(letter, **markup) | ||
else: | ||
self._progress_nodeids_reported.add(rep.nodeid) | ||
line = self._locationline(rep.nodeid, *rep.location) | ||
|
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 is now different, correct? Or does is it have the same outcome?
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.
write_fspath_result
does this:(and doesn't use
nodeid
otherwise) so the split is redundant here.