Update a disassembly test for Python 3.7

This commit is contained in:
Kodi Arfer 2018-03-24 12:33:44 -07:00
parent f27eda16e1
commit 268eba93fe

View File

@ -11,7 +11,7 @@
pytest) pytest)
(import sys) (import sys)
(import [hy._compat [PY3 PY35]]) (import [hy._compat [PY3 PY35 PY37]])
(defn test-sys-argv [] (defn test-sys-argv []
"NATIVE: test sys.argv" "NATIVE: test sys.argv"
@ -1606,18 +1606,21 @@
(defn test-disassemble [] (defn test-disassemble []
"NATIVE: Test the disassemble function" "NATIVE: Test the disassemble function"
(if PY35 (assert (= (disassemble '(do (leaky) (leaky) (macros))) (cond
(assert (= (disassemble '(do (leaky) (leaky) (macros))) [PY37 "Module(
"Module(
body=[Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])), body=[Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])),
Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])), Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])),
Expr(value=Call(func=Name(id='macros'), args=[], keywords=[]))])")) Expr(value=Call(func=Name(id='macros'), args=[], keywords=[]))],
(assert (= (disassemble '(do (leaky) (leaky) (macros))) docstring=None)"]
"Module( [PY35 "Module(
body=[Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])),
Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[])),
Expr(value=Call(func=Name(id='macros'), args=[], keywords=[]))])"]
[True "Module(
body=[ body=[
Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[], starargs=None, kwargs=None)), Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[], starargs=None, kwargs=None)),
Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[], starargs=None, kwargs=None)), Expr(value=Call(func=Name(id='leaky'), args=[], keywords=[], starargs=None, kwargs=None)),
Expr(value=Call(func=Name(id='macros'), args=[], keywords=[], starargs=None, kwargs=None))])"))) Expr(value=Call(func=Name(id='macros'), args=[], keywords=[], starargs=None, kwargs=None))])"])))
(assert (= (disassemble '(do (leaky) (leaky) (macros)) True) (assert (= (disassemble '(do (leaky) (leaky) (macros)) True)
"leaky() "leaky()
leaky() leaky()