add a module global for whether the current runtime supports the builtin breakpoint function
This commit is contained in:
parent
9edcb7edc6
commit
3bca983a95
|
@ -4,6 +4,12 @@ import pdb
|
|||
import sys
|
||||
from doctest import UnexpectedException
|
||||
|
||||
try:
|
||||
from builtins import breakpoint # noqa
|
||||
SUPPORTS_BREAKPOINT_BUILTIN = True
|
||||
except ImportError:
|
||||
SUPPORTS_BREAKPOINT_BUILTIN = False
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
group = parser.getgroup("general")
|
||||
|
|
|
@ -8,7 +8,8 @@ class TestDebugging(object):
|
|||
|
||||
def test_supports_breakpoint_module_global(self):
|
||||
"""
|
||||
Test that supports breakpoint global marks on Python 3.7+
|
||||
Test that supports breakpoint global marks on Python 3.7+ and not on
|
||||
CPython 3.5, 2.7
|
||||
"""
|
||||
if sys.version_info.major == 3 and sys.version_info.minor >= 7:
|
||||
assert SUPPORTS_BREAKPOINT_BUILTIN is True
|
||||
|
|
Loading…
Reference in New Issue