mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
committed by
GitHub
parent
c8ec29a3d8
commit
aef028be6e
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user