File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 26
26
from _pytest .main import EXIT_TESTSFAILED
27
27
from _pytest .main import EXIT_USAGEERROR
28
28
29
+ REPORT_COLLECTING_RESOLUTION = 0.5
30
+
29
31
30
32
class MoreQuietAction (argparse .Action ):
31
33
"""
@@ -512,7 +514,7 @@ def report_collect(self, final=False):
512
514
t = time .time ()
513
515
if (
514
516
self ._collect_report_last_write is not None
515
- and self ._collect_report_last_write > t - 0.5
517
+ and self ._collect_report_last_write > t - REPORT_COLLECTING_RESOLUTION
516
518
):
517
519
return
518
520
self ._collect_report_last_write = t
Original file line number Diff line number Diff line change @@ -142,6 +142,31 @@ def test_1():
142
142
child .sendeof ()
143
143
child .kill (15 )
144
144
145
+ def test_report_collect_after_half_a_second (self , testdir ):
146
+ """Test for "collecting" being updated after 0.5s"""
147
+
148
+ testdir .makepyfile (
149
+ ** {
150
+ "test1.py" : """
151
+ import _pytest.terminal
152
+
153
+ _pytest.terminal.REPORT_COLLECTING_RESOLUTION = 0
154
+
155
+ def test_1():
156
+ pass
157
+ """ ,
158
+ "test2.py" : "def test_2(): pass" ,
159
+ }
160
+ )
161
+
162
+ child = testdir .spawn_pytest ("-v test1.py test2.py" )
163
+ child .expect (r"collecting \.\.\." )
164
+ child .expect (r"collecting 1 item" )
165
+ child .expect (r"collecting 2 items" )
166
+ child .expect (r"collected 2 items" )
167
+ rest = child .read ().decode ("utf8" )
168
+ assert "2 passed in" in rest
169
+
145
170
def test_itemreport_subclasses_show_subclassed_file (self , testdir ):
146
171
testdir .makepyfile (
147
172
test_p1 = """
You can’t perform that action at this time.
0 commit comments