Skip to content

Commit 6530f42

Browse files
authored
Merge pull request #13191 from jakkdl/pluggy_gc
Fix subprocess gc disable in `test_refcycle_unraisiable_warning_filter_default`
2 parents 3930353 + 857daa8 commit 6530f42

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: testing/test_unraisableexception.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ def test_refcycle_unraisable_warning_filter_default(pytester: Pytester) -> None:
321321
# see: https://github.com/pytest-dev/pytest/pull/13057#discussion_r1888396126
322322
pytester.makepyfile(
323323
test_it="""
324+
import gc
325+
gc.disable()
326+
324327
import pytest
325328
326329
class BrokenDel:
@@ -335,8 +338,8 @@ def test_it():
335338
"""
336339
)
337340

338-
with _disable_gc():
339-
result = pytester.runpytest_subprocess("-Wdefault")
341+
# since we use subprocess we need to disable gc inside test_it
342+
result = pytester.runpytest_subprocess("-Wdefault")
340343

341344
assert result.ret == pytest.ExitCode.OK
342345

0 commit comments

Comments
 (0)