MCPcopy
hub / github.com/cool-RR/PySnooper / test_long_variable

Function test_long_variable

tests/test_pysnooper.py:541–566  ·  view source on GitHub ↗
(normalize)

Source from the content-addressed store, hash-verified

539
540@pytest.mark.parametrize("normalize", (True, False))
541def test_long_variable(normalize):
542 @pysnooper.snoop(normalize=normalize, color=False)
543 def my_function():
544 foo = list(range(1000))
545 return foo
546
547 with mini_toolbox.OutputCapturer(stdout=False,
548 stderr=True) as output_capturer:
549 result = my_function()
550 assert result == list(range(1000))
551 output = output_capturer.string_io.getvalue()
552 regex = r'^(?=.{100}$)\[0, 1, 2, .*\.\.\..*, 997, 998, 999\]$'
553 assert_output(
554 output,
555 (
556 SourcePathEntry(),
557 CallEntry('def my_function():'),
558 LineEntry('foo = list(range(1000))'),
559 VariableEntry('foo', value_regex=regex),
560 LineEntry(),
561 ReturnEntry(),
562 ReturnValueEntry(value_regex=regex),
563 ElapsedTimeEntry(),
564 ),
565 normalize=normalize,
566 )
567
568
569@pytest.mark.parametrize("normalize", (True, False))

Callers

nothing calls this directly

Calls 9

my_functionFunction · 0.85
assert_outputFunction · 0.85
SourcePathEntryClass · 0.85
CallEntryClass · 0.85
LineEntryClass · 0.85
VariableEntryClass · 0.85
ReturnEntryClass · 0.85
ReturnValueEntryClass · 0.85
ElapsedTimeEntryClass · 0.85

Tested by

no test coverage detected