Don't break into `pdb` for `raise unittest.SkipTest()`
This commit is contained in:
parent
15ac0349b2
commit
6e7917c1a0
|
@ -3,6 +3,7 @@ import argparse
|
|||
import functools
|
||||
import sys
|
||||
import types
|
||||
import unittest
|
||||
from typing import Any
|
||||
from typing import Callable
|
||||
from typing import Generator
|
||||
|
@ -293,7 +294,9 @@ class PdbInvoke:
|
|||
sys.stdout.write(out)
|
||||
sys.stdout.write(err)
|
||||
assert call.excinfo is not None
|
||||
_enter_pdb(node, call.excinfo, report)
|
||||
|
||||
if not isinstance(call.excinfo.value, unittest.SkipTest):
|
||||
_enter_pdb(node, call.excinfo, report)
|
||||
|
||||
def pytest_internalerror(self, excinfo: ExceptionInfo[BaseException]) -> None:
|
||||
tb = _postmortem_traceback(excinfo)
|
||||
|
|
|
@ -123,6 +123,18 @@ class TestPDB:
|
|||
)
|
||||
assert rep.skipped
|
||||
assert len(pdblist) == 0
|
||||
|
||||
def test_pdb_on_raise_skiptest(self, pytester, pdblist) -> None:
|
||||
rep = runpdb_and_get_report(
|
||||
pytester,
|
||||
"""
|
||||
import unittest
|
||||
|
||||
raise unittest.SkipTest("This is a common way to skip an entire file.")
|
||||
""",
|
||||
)
|
||||
assert rep.skipped
|
||||
assert len(pdblist) == 0
|
||||
|
||||
def test_pdb_on_BdbQuit(self, pytester, pdblist) -> None:
|
||||
rep = runpdb_and_get_report(
|
||||
|
|
Loading…
Reference in New Issue