add a module global for whether the current runtime supports the builtin breakpoint function

This commit is contained in:
Anthony Shaw 2018-03-22 17:27:28 +11:00
parent 9edcb7edc6
commit 3bca983a95
No known key found for this signature in database
GPG Key ID: AB4A19AE1CE85744
2 changed files with 8 additions and 1 deletions

View File

@ -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")

View File

@ -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