Remove unneeded getrawcode() calls from tests
This commit is contained in:
parent
04d68fbc9e
commit
5bfe793fd5
|
@ -59,9 +59,9 @@ def test_excinfo_getstatement():
|
||||||
except ValueError:
|
except ValueError:
|
||||||
excinfo = _pytest._code.ExceptionInfo.from_current()
|
excinfo = _pytest._code.ExceptionInfo.from_current()
|
||||||
linenumbers = [
|
linenumbers = [
|
||||||
_pytest._code.getrawcode(f).co_firstlineno - 1 + 4,
|
f.__code__.co_firstlineno - 1 + 4,
|
||||||
_pytest._code.getrawcode(f).co_firstlineno - 1 + 1,
|
f.__code__.co_firstlineno - 1 + 1,
|
||||||
_pytest._code.getrawcode(g).co_firstlineno - 1 + 1,
|
g.__code__.co_firstlineno - 1 + 1,
|
||||||
]
|
]
|
||||||
values = list(excinfo.traceback)
|
values = list(excinfo.traceback)
|
||||||
foundlinenumbers = [x.lineno for x in values]
|
foundlinenumbers = [x.lineno for x in values]
|
||||||
|
|
|
@ -478,7 +478,7 @@ def test_getfslineno():
|
||||||
fspath, lineno = getfslineno(f)
|
fspath, lineno = getfslineno(f)
|
||||||
|
|
||||||
assert fspath.basename == "test_source.py"
|
assert fspath.basename == "test_source.py"
|
||||||
assert lineno == _pytest._code.getrawcode(f).co_firstlineno - 1 # see findsource
|
assert lineno == f.__code__.co_firstlineno - 1 # see findsource
|
||||||
|
|
||||||
class A:
|
class A:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue