Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Jul 28, 2017
1 parent 06a4933 commit be401bc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
11 changes: 5 additions & 6 deletions _pytest/outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __repr__(self):
if isinstance(val, bytes):
val = py._builtin._totext(val, errors='replace')
return val
return "<%s instance>" %(self.__class__.__name__,)
return "<%s instance>" % (self.__class__.__name__,)
__str__ = __repr__


Expand Down Expand Up @@ -52,6 +52,7 @@ def __init__(self, msg="unknown reason"):

# exposed helper methods


def exit(msg):
""" exit testing process as if KeyboardInterrupt was triggered. """
__tracebackhide__ = True
Expand Down Expand Up @@ -87,7 +88,6 @@ def fail(msg="", pytrace=True):
fail.Exception = Failed



class XFailed(fail.Exception):
""" raised from an explicit call to pytest.xfail() """

Expand All @@ -101,15 +101,14 @@ def xfail(reason=""):
xfail.Exception = XFailed



def importorskip(modname, minversion=None):
""" return imported module if it has at least "minversion" as its
__version__ attribute. If no minversion is specified the a skip
is only triggered if the module can not be imported.
"""
import warnings
__tracebackhide__ = True
compile(modname, '', 'eval') # to catch syntaxerrors
compile(modname, '', 'eval') # to catch syntaxerrors
should_skip = False

with warnings.catch_warnings():
Expand All @@ -123,7 +122,7 @@ def importorskip(modname, minversion=None):
# Do not raise chained exception here(#1485)
should_skip = True
if should_skip:
raise Skipped("could not import %r" %(modname,), allow_module_level=True)
raise Skipped("could not import %r" % (modname,), allow_module_level=True)
mod = sys.modules[modname]
if minversion is None:
return mod
Expand All @@ -136,6 +135,6 @@ def importorskip(modname, minversion=None):
"pkg_resources to parse version strings." % (modname,),
allow_module_level=True)
if verattr is None or pv(verattr) < pv(minversion):
raise Skipped("module %r has __version__ %r, required is: %r" %(
raise Skipped("module %r has __version__ %r, required is: %r" % (
modname, verattr, minversion), allow_module_level=True)
return mod
1 change: 1 addition & 0 deletions _pytest/recwarn.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from _pytest.fixtures import yield_fixture
from _pytest.outcomes import fail


@yield_fixture
def recwarn():
"""Return a WarningsRecorder instance that provides these methods:
Expand Down
5 changes: 1 addition & 4 deletions _pytest/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#
# pytest plugin hooks


def pytest_addoption(parser):
group = parser.getgroup("terminal reporting", "reporting", after="general")
group.addoption('--durations',
Expand Down Expand Up @@ -505,7 +506,3 @@ def collect_one_node(collector):
if call and check_interactive_exception(call, rep):
ihook.pytest_exception_interact(node=collector, call=call, report=rep)
return rep




1 change: 0 additions & 1 deletion _pytest/skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def nop(*args, **kwargs):
)



class MarkEvaluator:
def __init__(self, item, name):
self.item = item
Expand Down
1 change: 0 additions & 1 deletion testing/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ def test_outcomeexception_passes_except_Exception():
pass



def test_pytest_exit():
try:
pytest.exit("hello")
Expand Down

0 comments on commit be401bc

Please sign in to comment.