diff --git a/changelog/4329.bugfix.rst b/changelog/4329.bugfix.rst new file mode 100644 index 00000000000..6acfe7e61b5 --- /dev/null +++ b/changelog/4329.bugfix.rst @@ -0,0 +1 @@ +Fix TypeError in report_collect with _collect_report_last_write. diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index a00dc08427e..dde2750be7e 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -497,7 +497,10 @@ def report_collect(self, final=False): if not final: # Only write "collecting" report every 0.5s. 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 self._collect_report_last_write = t