|
1 | 1 | # mypy: allow-untyped-defs |
2 | | -import os |
3 | 2 | import sys |
4 | 3 | from typing import List |
5 | 4 |
|
|
10 | 9 | import pytest |
11 | 10 |
|
12 | 11 |
|
13 | | -_ENVIRON_PYTHONBREAKPOINT = os.environ.get("PYTHONBREAKPOINT", "") |
14 | | - |
15 | | - |
16 | 12 | @pytest.fixture(autouse=True) |
17 | 13 | def pdb_env(request): |
18 | 14 | if "pytester" in request.fixturenames: |
@@ -959,7 +955,10 @@ def test_nothing(): pass |
959 | 955 | result = pytester.runpytest_subprocess(*args) |
960 | 956 | result.stdout.fnmatch_lines(["*1 passed in *"]) |
961 | 957 |
|
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) |
963 | 962 | p1 = pytester.makepyfile( |
964 | 963 | """ |
965 | 964 | def test_nothing(): |
@@ -1003,11 +1002,10 @@ def test_nothing(): pass |
1003 | 1002 | result = pytester.runpytest_subprocess(*args) |
1004 | 1003 | result.stdout.fnmatch_lines(["*1 passed in *"]) |
1005 | 1004 |
|
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) |
1011 | 1009 | p1 = pytester.makepyfile( |
1012 | 1010 | """ |
1013 | 1011 | def test_1(): |
|
0 commit comments