Thanks to visit codestin.com Credit goes to github.com
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 8ae3196 commit 9176e67Copy full SHA for 9176e67
1 file changed
tests/run_tests.py
@@ -70,13 +70,19 @@ def _run_tests(tests, verbose):
70
test_func()
71
72
73
-def _check_refleak(test_func):
74
- for iteration in range(6):
+def _check_refleak(test_func, verbose):
+ nrun = 6
75
+ for i in range(1, nrun + 1):
76
+ if verbose:
77
+ if i > 1:
78
+ print()
79
+ print(f"Run {i}/{nrun}:")
80
+
81
init_refcnt = sys.gettotalrefcount()
82
83
diff = sys.gettotalrefcount() - init_refcnt;
84
- if iteration > 3 and diff:
85
+ if i > 3 and diff:
86
raise AssertionError(f"refcnt leak, diff: {diff}")
87
88
@@ -93,7 +99,7 @@ def test_func():
93
99
_run_tests(tests, VERBOSE)
94
100
95
101
if check_refleak:
96
- _check_refleak(test_func)
102
+ _check_refleak(test_func, VERBOSE)
97
103
else:
98
104
105
0 commit comments