Skip to content

Commit 72ede36

Browse files
committed
Use subprocess to test module cleanup
1 parent 8b78e23 commit 72ede36

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

tests/test_functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ def test_interfaces():
231231
_mpmath_normalize(1, mpz(111), 1j, 12, 13, "c")
232232
with pytest.raises(ValueError, match="invalid rounding mode specified"):
233233
_mpmath_normalize(1, mpz(111), 11, 12, 13, 1j)
234-
gmp._free_cache() # just for coverage
235234

236235

237236
# See pypy/pypy#5368 and oracle/graalpython#593

tests/test_mpz.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import sys
99
import warnings
1010
from concurrent.futures import ThreadPoolExecutor
11+
from subprocess import run
1112

1213
import pytest
1314
from gmp import mpz
@@ -1092,3 +1093,10 @@ def test_int_api():
10921093
continue
10931094
mz_sig = inspect.signature(mz)
10941095
assert m_sig == mz_sig
1096+
1097+
1098+
def test_mpz_clear():
1099+
# for coverage (test module cleanup)
1100+
res = run(["python", "-c",
1101+
"import gmp; a = gmp.mpz(1); del a; gmp._free_cache()"])
1102+
assert res.returncode == 0

0 commit comments

Comments
 (0)