Skip to content

Commit 9bb4e77

Browse files
committed
fix(tests): ensure import hook is registered before pynecore imports
Register the import hook at the top of conftest.py to guarantee AST transformations work, even if __pycache__ is deleted. This change prevents issues with module imports during test execution.
1 parent ec129b5 commit 9bb4e77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
from pathlib import Path
1111

12+
# Register the import hook BEFORE any pynecore imports
13+
# This ensures AST transformations work even when __pycache__ is deleted
14+
from pynecore.core import import_hook # noqa - This must be first!
15+
1216
from pynecore.types.na import NA
1317
from pynecore.core.script_runner import ScriptRunner
1418
from pynecore.types.ohlcv import OHLCV

0 commit comments

Comments
 (0)