-
Notifications
You must be signed in to change notification settings - Fork 26
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
It doesn't considered how much time was spent on SetupTestData #19
Comments
Agreed, it would be awesome to extract the time spend on |
I have modified the def run(self, result, debug=False):
topLevel = False
if getattr(result, '_testRunEntered', False) is False:
result._testRunEntered = topLevel = True
for test in self:
if result.shouldStop:
break
if _isnotsuite(test):
start_time = _time()
self._tearDownPreviousClass(test, result)
self._handleModuleFixture(test, result)
self._handleClassSetUp(test, result)
result._previousTestClass = test.__class__
if (getattr(test.__class__, '_classSetupFailed', False) or
getattr(result, '_moduleSetUpFailed', False)):
continue
self.save_test_time(
f'{test.__class__.__module__}.{test.__class__.__name__}.setUp '
f'({importlib.import_module(test.__class__.__module__).__file__})',
_time() - start_time
)
start_time = _time()
if not debug:
test(result)
else:
test.debug()
self.save_test_time(str(test), _time() - start_time)
if topLevel:
self._tearDownPreviousClass(None, result)
self._handleModuleTearDown(result)
result._testRunEntered = False
return result |
drewbrew
added a commit
to drewbrew/django-slow-tests
that referenced
this issue
Oct 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Time spent on SetupTestData is counted into the first test in the testcase. That's not fair to compare.
The text was updated successfully, but these errors were encountered: