MCPcopy
hub / github.com/rocky/python-uncompyle6 / test_single_mode

Function test_single_mode

pytest/test_single_compile.py:8–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def test_single_mode():
9 single_expressions = (
10 "i = 1",
11 "i and (j or k)",
12 "i += 1",
13 "i = j % 4",
14 "i = {}",
15 "i = []",
16 "for i in range(10):\n i\n",
17 "for i in range(10):\n for j in range(10):\n i + j\n",
18 # 'try:\n i\nexcept Exception:\n j\nelse:\n k\n'
19 )
20
21 for expr in single_expressions:
22 code = compile(expr + "\n", "<string>", "single")
23 got = code_deparse(code, compile_mode="single").text
24 assert got == expr + "\n"

Callers

nothing calls this directly

Calls 1

code_deparseFunction · 0.90

Tested by

no test coverage detected