File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -4865,8 +4865,16 @@ def block_ads(self):
4865
4865
self .ad_block ()
4866
4866
4867
4867
def _print (self , msg ):
4868
- """ Same as Python's print() """
4869
- print (msg )
4868
+ """Same as Python's print(), but won't print during multithreaded runs
4869
+ because overlapping print() commands may lead to unexpected output.
4870
+ In most cases, the print() command won't print for multithreaded tests,
4871
+ but there are some exceptions, and this will take care of those.
4872
+ Here's an example of running tests multithreaded: "pytest -n=4".
4873
+ To force a print during multithreaded tests, use: "sys.stderr.write()".
4874
+ To print without the new-line character end, use: "sys.stdout.write()".
4875
+ """
4876
+ if not sb_config ._multithreaded :
4877
+ print (msg )
4870
4878
4871
4879
def start_tour (self , name = None , interval = 0 ):
4872
4880
self .play_tour (name = name , interval = interval )
You can’t perform that action at this time.
0 commit comments