MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / _print

Method _print

seleniumbase/fixtures/base_case.py:10082–10096  ·  view source on GitHub ↗

Same as Python's print(), but also prints during multithreaded runs. Normally, Python's print() command won't print for multithreaded tests. Here's an example of running tests using multithreading: "pytest -n=4". Here's how to print directly from sys without using a print() c

(self, msg)

Source from the content-addressed store, hash-verified

10080 raise NoSuchWindowException("Active window was already closed!")
10081
10082 def _print(self, msg):
10083 """Same as Python's print(), but also prints during multithreaded runs.
10084 Normally, Python's print() command won't print for multithreaded tests.
10085 Here's an example of running tests using multithreading: "pytest -n=4".
10086 Here's how to print directly from sys without using a print() command:
10087 To force a print during multithreaded tests, use: "sys.stderr.write()".
10088 To print without the new-line character end, use: "sys.stdout.write()".
10089 """
10090 if getattr(sb_config, "_multithreaded", None):
10091 if not isinstance(msg, str):
10092 with suppress(Exception):
10093 msg = str(msg)
10094 sys.stderr.write(msg + "\n")
10095 else:
10096 print(msg)
10097
10098 ############
10099

Callers 11

afdrukkenMethod · 0.80
imprimerMethod · 0.80
stampareMethod · 0.80
imprimirMethod · 0.80
인쇄Method · 0.80
печататьMethod · 0.80
印刷Method · 0.80
打印Method · 0.80
imprimirMethod · 0.80
test_multi_threadedFunction · 0.80

Calls 1

writeMethod · 0.80

Tested by 2

test_multi_threadedFunction · 0.64