Skip to content

Commit

Permalink
fixup! Add some simpler tests to help find Decompiler mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
jspricke authored and kozlovsky committed Sep 5, 2023
1 parent cf70486 commit bd79bf9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pony/orm/tests/test_decompiler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import textwrap
import unittest
import ast
import sys

from pony.orm.decompiling import Decompiler
from pony.orm.asttranslation import ast2src
Expand Down Expand Up @@ -96,6 +97,10 @@ def get_condition_values(cond):

class TestDecompiler(unittest.TestCase):
def assertDecompilesTo(self, src, expected):
# skip test due to ast.dump has no indent parameter
if sys.version_info[:2] <= (3, 8):
return

code = compile(src, '<?>', 'eval').co_consts[0]
import dis
print(dis.dis(code))
Expand Down

0 comments on commit bd79bf9

Please sign in to comment.