Skip to content

Commit 5e2ee71

Browse files
committed
monkeypatch.delenv PYTHONBREAKPOINT in two tests that previously failed/skipped
1 parent 6ed0051 commit 5e2ee71

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Diff for: testing/test_debugging.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# mypy: allow-untyped-defs
2-
import os
32
import sys
43
from typing import List
54

@@ -10,9 +9,6 @@
109
import pytest
1110

1211

13-
_ENVIRON_PYTHONBREAKPOINT = os.environ.get("PYTHONBREAKPOINT", "")
14-
15-
1612
@pytest.fixture(autouse=True)
1713
def pdb_env(request):
1814
if "pytester" in request.fixturenames:
@@ -959,7 +955,10 @@ def test_nothing(): pass
959955
result = pytester.runpytest_subprocess(*args)
960956
result.stdout.fnmatch_lines(["*1 passed in *"])
961957

962-
def test_pdb_custom_cls(self, pytester: Pytester, custom_debugger_hook) -> None:
958+
def test_pdb_custom_cls(
959+
self, pytester: Pytester, custom_debugger_hook, monkeypatch: MonkeyPatch
960+
) -> None:
961+
monkeypatch.delenv("PYTHONBREAKPOINT", raising=False)
963962
p1 = pytester.makepyfile(
964963
"""
965964
def test_nothing():
@@ -1003,11 +1002,10 @@ def test_nothing(): pass
10031002
result = pytester.runpytest_subprocess(*args)
10041003
result.stdout.fnmatch_lines(["*1 passed in *"])
10051004

1006-
@pytest.mark.skipif(
1007-
not _ENVIRON_PYTHONBREAKPOINT == "",
1008-
reason="Requires breakpoint() default value",
1009-
)
1010-
def test_sys_breakpoint_interception(self, pytester: Pytester) -> None:
1005+
def test_sys_breakpoint_interception(
1006+
self, pytester: Pytester, monkeypatch: MonkeyPatch
1007+
) -> None:
1008+
monkeypatch.delenv("PYTHONBREAKPOINT", raising=False)
10111009
p1 = pytester.makepyfile(
10121010
"""
10131011
def test_1():

0 commit comments

Comments
 (0)