code/source: inline getsource()
The recursive way in which Source and getsource interact is a bit confusing, just inline it.
This commit is contained in:
@@ -307,12 +307,10 @@ if True:
|
||||
pass
|
||||
|
||||
|
||||
def test_getsource_fallback() -> None:
|
||||
from _pytest._code.source import getsource
|
||||
|
||||
def test_source_fallback() -> None:
|
||||
src = Source(x)
|
||||
expected = """def x():
|
||||
pass"""
|
||||
src = getsource(x)
|
||||
assert str(src) == expected
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user