We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffb23cd commit 2b17c13Copy full SHA for 2b17c13
numpy/_core/tests/test_nditer.py
@@ -1,4 +1,5 @@
1
import sys
2
+import sysconfig
3
import pytest
4
5
import textwrap
@@ -13,6 +14,7 @@
13
14
IS_WASM, HAS_REFCOUNT, suppress_warnings, break_cycles
15
)
16
17
+NOGIL_BUILD = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
18
19
def iter_multi_index(i):
20
ret = []
@@ -68,7 +70,9 @@ def test_iter_refcount():
68
70
rc2_dt = sys.getrefcount(dt)
69
71
it2 = it.copy()
72
assert_(sys.getrefcount(a) > rc2_a)
- assert_(sys.getrefcount(dt) > rc2_dt)
73
+ if not NOGIL_BUILD:
74
+ # np.dtype('f4') is immortal in the nogil build
75
+ assert_(sys.getrefcount(dt) > rc2_dt)
76
it = None
77
assert_equal(sys.getrefcount(a), rc2_a)
78
assert_equal(sys.getrefcount(dt), rc2_dt)
0 commit comments