Move module error compatibility code to _pytest.compat

This commit is contained in:
Bruno Oliveira 2016-12-27 22:01:22 -02:00
parent 6b24ce2a9d
commit 515fb09995
2 changed files with 4 additions and 3 deletions

View File

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

View File

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