]> gitweb.factorcode.org Git - factor.git/commitdiff
python.tests: fix test that broke for unknown reason on python 2.7.12
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 21 Nov 2016 03:59:03 +0000 (04:59 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Mon, 21 Nov 2016 03:59:03 +0000 (04:59 +0100)
extra/python/python-tests.factor

index 599c602a74759f278620cdb0cdfcf9547315546d..3ad05bb7171655458136025d10fa67f12e4132ec 100644 (file)
@@ -12,15 +12,15 @@ IN: python
 ] py-test
 
 ! Pretty sure the # of None references should stay constant.
-{ t } [
+: count-none-refs ( -- n )
     [
         "sys" py-import "getrefcount" getattr
         <none> <1py-tuple> call-object py>
-    ] with-destructors
-    [
-        "sys" py-import "getrefcount" getattr
-        <none> <1py-tuple> call-object py>
-    ] with-destructors =
+    ] with-destructors ;
+{ t } [
+    ! For some reason, the count increased by one the first time.
+    count-none-refs drop
+    count-none-refs count-none-refs =
 ] unit-test
 
 { } [ { f f f } >py drop ] py-test