From 0eb407676828fd6a24e9aafc5b10988026548954 Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Tue, 11 Oct 2016 20:14:14 -0700 Subject: [PATCH] Require Python 3 for neg? and pos? type tests Python 2 allows 2 < "hello" and the like. --- tests/native_tests/core.hy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/native_tests/core.hy b/tests/native_tests/core.hy index ee74b6f..0bf1d4f 100644 --- a/tests/native_tests/core.hy +++ b/tests/native_tests/core.hy @@ -19,6 +19,8 @@ ;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ;; DEALINGS IN THE SOFTWARE. +(import [hy._compat [PY3]]) + ;;;; some simple helpers (defn assert-true [x] @@ -389,7 +391,8 @@ (assert-true (neg? -2)) (assert-false (neg? 1)) (assert-false (neg? 0)) - (assert-requires-num neg?)) + (when PY3 + (assert-requires-num neg?))) (defn test-zero [] "NATIVE: testing the zero? function" @@ -479,7 +482,8 @@ (assert-true (pos? 2)) (assert-false (pos? -1)) (assert-false (pos? 0)) - (assert-requires-num pos?)) + (when PY3 + (assert-requires-num pos?))) (defn test-remove [] "NATIVE: testing the remove function"