-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathlocationTestData.py
More file actions
40 lines (32 loc) · 840 Bytes
/
locationTestData.py
File metadata and controls
40 lines (32 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import inspect
# no other imports here (put them below) to keep the line number for myFun stable
lineNoMyFunDef = 12
lineNoMyFunCall = lineNoMyFunDef + 2
lineNoMyFunNoResultDef = 19
lineNoTestRecordDef = 26
def blub(i: int) -> int:
return i + 1
def myFun(a: str, b: list[int], depth: int=0) -> inspect.FrameInfo:
if depth == 0:
return myFun("blub", [42, 0], 1) # that's the call
else:
stack = inspect.stack()
return stack[1]
def myFunNoResult(depth: int=0):
if depth == 0:
return myFunNoResult(1)
else:
stack = inspect.stack()
return stack[1]
class TestRecord:
x: int
y: str
z: float = 3.14
lineFooBase = 35
lineFooSub = 39
class Base:
def foo(self, x: int, y: str):
pass
class Sub(Base):
def foo(self, y: int, x: float):
pass