assert that custom PDB class is used as breakpoint hook where supported
This commit is contained in:
parent
3bca983a95
commit
91d99affb7
|
@ -1,8 +1,9 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from _pytest.debugging import SUPPORTS_BREAKPOINT_BUILTIN
|
from _pytest.debugging import SUPPORTS_BREAKPOINT_BUILTIN, pytestPDB
|
||||||
|
import pytest
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
class TestDebugging(object):
|
class TestDebugging(object):
|
||||||
|
|
||||||
|
@ -17,3 +18,11 @@ class TestDebugging(object):
|
||||||
assert SUPPORTS_BREAKPOINT_BUILTIN is False
|
assert SUPPORTS_BREAKPOINT_BUILTIN is False
|
||||||
if sys.version_info.major == 2 and sys.version_info.minor == 7:
|
if sys.version_info.major == 2 and sys.version_info.minor == 7:
|
||||||
assert SUPPORTS_BREAKPOINT_BUILTIN is False
|
assert SUPPORTS_BREAKPOINT_BUILTIN is False
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info < (3,7), reason="Requires python3.7")
|
||||||
|
def test_sys_breakpointhook(self):
|
||||||
|
"""
|
||||||
|
Test that sys.breakpointhook is set to the custom Pdb class
|
||||||
|
"""
|
||||||
|
if 'PYTHONBREAKPOINT' not in os.environ or os.environ['PYTHONBREAKPOINT'] == '':
|
||||||
|
assert isinstance(sys.breakpointhook, pytestPDB)
|
||||||
|
|
Loading…
Reference in New Issue