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

1 

2from inline_snapshot import snapshot 

3 

4from .test_loader import check_script 

5 

6 

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 

19 

20test() 

21 

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 )