Coverage for tests/test_exec.py: 100%
4 statements
« prev ^ index » next coverage.py v7.4.1, created at 2024-02-12 09:19 +0100
« prev ^ index » next coverage.py v7.4.1, created at 2024-02-12 09:19 +0100
2from inline_snapshot import snapshot
4from .test_loader import check_script
7def test_exec():
8 check_script(
9 {
10"test_pck/__init__.py":"",
11 "test_pck/a.py":"a='some text'",
12 "test_pck/b.py":"""
13from .a import a
14def test():
15 exec('print(a)')
16"""},
17 """
18from test_pck.b import test
20test()
22 """,
23 transformed_stdout=snapshot("<equal to normal>"),
24 transformed_stderr=snapshot("<equal to normal>"),
25 normal_stdout=snapshot("""\
26some text
27"""),
28 normal_stderr=snapshot(""),
29 )