fix appharness regex for functions with return type (#2512)
This commit is contained in:
parent
6d33156d15
commit
9ce4e85050
@ -189,7 +189,9 @@ class AppHarness:
|
||||
if isinstance(app_source, str):
|
||||
return app_source
|
||||
source = inspect.getsource(app_source)
|
||||
source = re.sub(r"^\s*def\s+\w+\s*\(.*?\):", "", source, flags=re.DOTALL)
|
||||
source = re.sub(
|
||||
r"^\s*def\s+\w+\s*\(.*?\)(\s+->\s+\w+)?:", "", source, flags=re.DOTALL
|
||||
)
|
||||
return textwrap.dedent(source)
|
||||
|
||||
def _initialize_app(self):
|
||||
|
Loading…
Reference in New Issue
Block a user