Remove checks in tests for Python 3.5

This commit is contained in:
Kodi Arfer 2019-03-17 18:30:42 -04:00
parent 0fe7f42efc
commit 85f203ba43
3 changed files with 7 additions and 7 deletions

View File

@ -11,7 +11,7 @@
pytest) pytest)
(import sys) (import sys)
(import [hy._compat [PY3 PY35 PY37]]) (import [hy._compat [PY3 PY37]])
(defn test-sys-argv [] (defn test-sys-argv []
"NATIVE: test sys.argv" "NATIVE: test sys.argv"
@ -1550,7 +1550,7 @@ cee\"} dee" "ey bee\ncee dee"))
(defn test-disassemble [] (defn test-disassemble []
"NATIVE: Test the disassemble function" "NATIVE: Test the disassemble function"
(assert (= (disassemble '(do (leaky) (leaky) (macros))) (cond (assert (= (disassemble '(do (leaky) (leaky) (macros))) (cond
[PY35 "Module( [PY3 "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=[]))])"]

View File

@ -2,7 +2,7 @@
;; This file is part of Hy, which is free software licensed under the Expat ;; This file is part of Hy, which is free software licensed under the Expat
;; license. See the LICENSE. ;; license. See the LICENSE.
(import [hy._compat [PY35]]) (import [hy._compat [PY3]])
(setv square (fn [x] (setv square (fn [x]
(* x x))) (* x x)))
@ -191,7 +191,7 @@
(defn test-matmul [] (defn test-matmul []
"NATIVE: test matrix multiplication" "NATIVE: test matrix multiplication"
(if PY35 (if PY3
(assert (= (@ first-test-matrix second-test-matrix) (assert (= (@ first-test-matrix second-test-matrix)
product-of-test-matrices)) product-of-test-matrices))
;; Python <= 3.4 ;; Python <= 3.4
@ -205,6 +205,6 @@
(setv matrix first-test-matrix (setv matrix first-test-matrix
matmul-attempt (try (@= matrix second-test-matrix) matmul-attempt (try (@= matrix second-test-matrix)
(except [e [Exception]] e))) (except [e [Exception]] e)))
(if PY35 (if PY3
(assert (= product-of-test-matrices matrix)) (assert (= product-of-test-matrices matrix))
(assert (isinstance matmul-attempt NameError)))) (assert (isinstance matmul-attempt NameError))))

View File

@ -2,7 +2,7 @@
;; This file is part of Hy, which is free software licensed under the Expat ;; This file is part of Hy, which is free software licensed under the Expat
;; license. See the LICENSE. ;; license. See the LICENSE.
(import pytest [hy._compat [PY35]]) (import pytest [hy._compat [PY3]])
(defmacro op-and-shadow-test [op &rest body] (defmacro op-and-shadow-test [op &rest body]
; Creates two tests with the given `body`, one where all occurrences ; Creates two tests with the given `body`, one where all occurrences
@ -102,7 +102,7 @@
(forbid (f 1 2 3))) (forbid (f 1 2 3)))
(when PY35 (op-and-shadow-test @ (when PY3 (op-and-shadow-test @
(defclass C [object] [ (defclass C [object] [
__init__ (fn [self content] (setv self.content content)) __init__ (fn [self content] (setv self.content content))
__matmul__ (fn [self other] (C (+ self.content other.content)))]) __matmul__ (fn [self other] (C (+ self.content other.content)))])