Fix TypeError in report_collect with _collect_report_last_write
`_collect_report_last_write` might be None, when `pytest_collection` was not called before. Not sure if this indicates another problem, but it can be reproduced with `testing/test_collection.py::TestCollector::()::test_getcustomfile_roundtrip`. Fixes https://github.com/pytest-dev/pytest/issues/4329
This commit is contained in:
parent
64762d2cfc
commit
91404db284
|
@ -0,0 +1 @@
|
||||||
|
Fix TypeError in report_collect with _collect_report_last_write.
|
|
@ -497,7 +497,10 @@ class TerminalReporter(object):
|
||||||
if not final:
|
if not final:
|
||||||
# Only write "collecting" report every 0.5s.
|
# Only write "collecting" report every 0.5s.
|
||||||
t = time.time()
|
t = time.time()
|
||||||
if self._collect_report_last_write > t - 0.5:
|
if (
|
||||||
|
self._collect_report_last_write is not None
|
||||||
|
and self._collect_report_last_write > t - 0.5
|
||||||
|
):
|
||||||
return
|
return
|
||||||
self._collect_report_last_write = t
|
self._collect_report_last_write = t
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue