Move module error compatibility code to _pytest.compat
This commit is contained in:
parent
6b24ce2a9d
commit
515fb09995
|
@ -26,6 +26,9 @@ _PY2 = not _PY3
|
|||
NoneType = type(None)
|
||||
NOTSET = object()
|
||||
|
||||
PY36 = sys.version_info[:2] >= (3, 6)
|
||||
MODULE_NOT_FOUND_ERROR = 'ModuleNotFoundError' if PY36 else 'ImportError'
|
||||
|
||||
if hasattr(inspect, 'signature'):
|
||||
def _format_args(func):
|
||||
return str(inspect.signature(func))
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
# encoding: utf-8
|
||||
import sys
|
||||
import _pytest._code
|
||||
from _pytest.compat import MODULE_NOT_FOUND_ERROR
|
||||
from _pytest.doctest import DoctestItem, DoctestModule, DoctestTextfile
|
||||
import pytest
|
||||
|
||||
PY36 = sys.version_info[:2] >= (3, 6)
|
||||
MODULE_NOT_FOUND_ERROR = 'ModuleNotFoundError' if PY36 else 'ImportError'
|
||||
|
||||
|
||||
class TestDoctests:
|
||||
|
||||
|
|
Loading…
Reference in New Issue