diff --git a/_pytest/_code/source.py b/_pytest/_code/source.py index 304a75289..ca2a11fb4 100644 --- a/_pytest/_code/source.py +++ b/_pytest/_code/source.py @@ -26,7 +26,7 @@ class Source(object): for part in parts: if not part: partlines = [] - if isinstance(part, Source): + elif isinstance(part, Source): partlines = part.lines elif isinstance(part, (tuple, list)): partlines = [x.rstrip("\n") for x in part] @@ -239,7 +239,6 @@ def getfslineno(obj): # helper functions # - def findsource(obj): try: sourcelines, lineno = inspect.findsource(obj)