Skip to content

Commit 923f26f

Browse files
committed
Import Hotfix
1 parent 53e16f7 commit 923f26f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/inline/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,9 @@ def _find(self, tests, obj, module, globs, seen):
11701170
######################################################################
11711171
class InlineTestRunner:
11721172
def run(self, test: InlineTest, out: List) -> None:
1173-
tree = ast.parse(test.to_test())
1173+
test_str = test.write_imports()
1174+
test_str += test.to_test()
1175+
tree = ast.parse(test_str)
11741176
codeobj = compile(tree, filename="<ast>", mode="exec")
11751177
start_time = time.time()
11761178
if test.timeout > 0:

0 commit comments

Comments
 (0)