Fix #1834 - Throw an error if more than a terminal exists (#1837)

This commit is contained in:
Andrea Giammarchi
2023-11-03 15:19:30 +01:00
committed by GitHub
parent c8ec29a3d8
commit aef028be6e
4 changed files with 71 additions and 12 deletions

View File

@@ -118,6 +118,20 @@ def only_main(fn):
return decorated
def only_worker(fn):
"""
Decorator to mark a test which make sense only in the worker thread
"""
@functools.wraps(fn)
def decorated(self, *args):
if self.execution_thread != "worker":
return
return fn(self, *args)
return decorated
def filter_inner_text(text, exclude=None):
return "\n".join(filter_page_content(text.splitlines(), exclude=exclude))