mirror of https://github.com/cool-RR/PySnooper.git
Variable ordering test
This commit is contained in:
parent
17d8a41b3b
commit
2a6b2b4299
|
@ -982,6 +982,39 @@ def test_cellvars():
|
|||
)
|
||||
)
|
||||
|
||||
def test_var_order():
|
||||
string_io = io.StringIO()
|
||||
|
||||
def f(one, two, three, four):
|
||||
five, six, seven = 5, 6, 7
|
||||
|
||||
with pysnooper.snoop(string_io, depth=2):
|
||||
result = f(1, 2, 3, 4)
|
||||
|
||||
output = string_io.getvalue()
|
||||
assert_output(
|
||||
output,
|
||||
(
|
||||
VariableEntry(),
|
||||
VariableEntry(),
|
||||
|
||||
LineEntry('result = f(1, 2, 3, 4)'),
|
||||
VariableEntry("one", "1"),
|
||||
VariableEntry("two", "2"),
|
||||
VariableEntry("three", "3"),
|
||||
VariableEntry("four", "4"),
|
||||
|
||||
CallEntry('def f(one, two, three, four):'),
|
||||
LineEntry(),
|
||||
VariableEntry("five", "5"),
|
||||
VariableEntry("six", "6"),
|
||||
VariableEntry("seven", "7"),
|
||||
ReturnEntry(),
|
||||
ReturnValueEntry(),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
def test_truncate():
|
||||
max_length = 20
|
||||
|
|
Loading…
Reference in New Issue