Skip to content

Commit

Permalink
Remove inspect call from top level (#3833)
Browse files Browse the repository at this point in the history
## 📝 Summary

resolves #3828

## 🔍 Description of Changes

toplevel inspect may have been causing issues in pypi imports

@akshayka OR @mscolnick
  • Loading branch information
dmadisetti authored Feb 18, 2025
1 parent 3ff5db8 commit 39673fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions marimo/_ast/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ def _pytest_scaffold(stub: Any) -> Any:
return stub(stub=stub)


PYTEST_BASE = ast.parse(inspect.getsource(_pytest_scaffold))


def wrap_fn_for_pytest(func: Fn, cell: Cell) -> Callable[..., Any]:
# Avoid declaring the function in the global scope, since it may cause
# issues with meta-analysis tools like cxfreeze (see #3828).
PYTEST_BASE = ast.parse(inspect.getsource(_pytest_scaffold))

# We modify the signature of the cell function such that pytest
# does not attempt to use the arguments as fixtures.

Expand Down

0 comments on commit 39673fb

Please sign in to comment.