Fixed E302 flake8 errors
expected 2 blank lines, found 0
This commit is contained in:
@@ -12,6 +12,7 @@ def test_ne():
|
||||
code2 = _pytest._code.Code(compile('foo = "baz"', '', 'exec'))
|
||||
assert code2 != code1
|
||||
|
||||
|
||||
def test_code_gives_back_name_for_not_existing_file():
|
||||
name = 'abc-123'
|
||||
co_code = compile("pass\n", name, 'exec')
|
||||
@@ -20,6 +21,7 @@ def test_code_gives_back_name_for_not_existing_file():
|
||||
assert str(code.path) == name
|
||||
assert code.fullsource is None
|
||||
|
||||
|
||||
def test_code_with_class():
|
||||
class A(object):
|
||||
pass
|
||||
@@ -30,11 +32,13 @@ if True:
|
||||
def x():
|
||||
pass
|
||||
|
||||
|
||||
def test_code_fullsource():
|
||||
code = _pytest._code.Code(x)
|
||||
full = code.fullsource
|
||||
assert 'test_code_fullsource()' in str(full)
|
||||
|
||||
|
||||
def test_code_source():
|
||||
code = _pytest._code.Code(x)
|
||||
src = code.source()
|
||||
@@ -42,6 +46,7 @@ def test_code_source():
|
||||
pass"""
|
||||
assert str(src) == expected
|
||||
|
||||
|
||||
def test_frame_getsourcelineno_myself():
|
||||
def func():
|
||||
return sys._getframe(0)
|
||||
@@ -50,6 +55,7 @@ def test_frame_getsourcelineno_myself():
|
||||
source, lineno = f.code.fullsource, f.lineno
|
||||
assert source[lineno].startswith(" return sys._getframe(0)")
|
||||
|
||||
|
||||
def test_getstatement_empty_fullsource():
|
||||
def func():
|
||||
return sys._getframe(0)
|
||||
@@ -62,6 +68,7 @@ def test_getstatement_empty_fullsource():
|
||||
finally:
|
||||
f.code.__class__.fullsource = prop
|
||||
|
||||
|
||||
def test_code_from_func():
|
||||
co = _pytest._code.Code(test_frame_getsourcelineno_myself)
|
||||
assert co.firstlineno
|
||||
@@ -92,6 +99,7 @@ def test_unicode_handling_syntax_error():
|
||||
if sys.version_info[0] < 3:
|
||||
unicode(excinfo)
|
||||
|
||||
|
||||
def test_code_getargs():
|
||||
def f1(x):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user