summaryrefslogtreecommitdiff
path: root/testing/code
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2017-11-10 18:33:02 -0200
committerBruno Oliveira <nicoddemus@gmail.com>2017-11-10 18:33:02 -0200
commit983a09a2d49fddf277e587edc3e87eb8b8f34308 (patch)
tree145334a322267f2a6df3d981cb3f445e4e872300 /testing/code
parentc33074c8b9d11d0806ae7da73ad99d96a88539ab (diff)
parent66fbebfc264722137a223d1f918061c609ddd8a1 (diff)
downloadpytest-983a09a2d49fddf277e587edc3e87eb8b8f34308.tar.gz
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
Diffstat (limited to 'testing/code')
-rw-r--r--testing/code/test_excinfo.py12
-rw-r--r--testing/code/test_source.py8
-rw-r--r--testing/code/test_source_multiline_block.py4
3 files changed, 12 insertions, 12 deletions
diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py
index 2086748e9..34db8ffa1 100644
--- a/testing/code/test_excinfo.py
+++ b/testing/code/test_excinfo.py
@@ -76,8 +76,8 @@ def test_excinfo_getstatement():
linenumbers = [_pytest._code.getrawcode(f).co_firstlineno - 1 + 4,
_pytest._code.getrawcode(f).co_firstlineno - 1 + 1,
_pytest._code.getrawcode(g).co_firstlineno - 1 + 1, ]
- l = list(excinfo.traceback)
- foundlinenumbers = [x.lineno for x in l]
+ values = list(excinfo.traceback)
+ foundlinenumbers = [x.lineno for x in values]
assert foundlinenumbers == linenumbers
# for x in info:
# print "%s:%d %s" %(x.path.relto(root), x.lineno, x.statement)
@@ -243,7 +243,7 @@ class TestTraceback_f_g_h(object):
def f(n):
try:
do_stuff()
- except:
+ except: # noqa
reraise_me()
excinfo = pytest.raises(RuntimeError, f, 8)
@@ -430,7 +430,7 @@ class TestFormattedExcinfo(object):
exec(source.compile())
except KeyboardInterrupt:
raise
- except:
+ except: # noqa
return _pytest._code.ExceptionInfo()
assert 0, "did not raise"
@@ -1213,7 +1213,7 @@ def test_exception_repr_extraction_error_on_recursion():
try:
a(numpy_like())
- except:
+ except: # noqa
from _pytest._code.code import ExceptionInfo
from _pytest.pytester import LineMatcher
exc_info = ExceptionInfo()
@@ -1237,7 +1237,7 @@ def test_no_recursion_index_on_recursion_error():
return getattr(self, '_' + attr)
RecursionDepthError().trigger
- except:
+ except: # noqa
from _pytest._code.code import ExceptionInfo
exc_info = ExceptionInfo()
assert 'maximum recursion' in str(exc_info.getrepr())
diff --git a/testing/code/test_source.py b/testing/code/test_source.py
index ed45f0896..8eda68a6e 100644
--- a/testing/code/test_source.py
+++ b/testing/code/test_source.py
@@ -155,8 +155,8 @@ class TestAccesses(object):
assert len(self.source) == 4
def test_iter(self):
- l = [x for x in self.source]
- assert len(l) == 4
+ values = [x for x in self.source]
+ assert len(values) == 4
class TestSourceParsingAndCompiling(object):
@@ -329,8 +329,8 @@ def test_getstartingblock_singleline():
x = A('x', 'y')
- l = [i for i in x.source.lines if i.strip()]
- assert len(l) == 1
+ values = [i for i in x.source.lines if i.strip()]
+ assert len(values) == 1
def test_getline_finally():
diff --git a/testing/code/test_source_multiline_block.py b/testing/code/test_source_multiline_block.py
index 4e8735d0c..b356d191f 100644
--- a/testing/code/test_source_multiline_block.py
+++ b/testing/code/test_source_multiline_block.py
@@ -22,5 +22,5 @@ def test_getstartingblock_multiline():
,
'z')
- l = [i for i in x.source.lines if i.strip()]
- assert len(l) == 4
+ values = [i for i in x.source.lines if i.strip()]
+ assert len(values) == 4