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

Function test_single_watch_no_comma

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

Source from the content-addressed store, hash-verified

496
497@pytest.mark.parametrize("normalize", (True, False))
498def test_single_watch_no_comma(normalize):
499 class Foo(object):
500 def __init__(self):
501 self.x = 2
502
503 def square(self):
504 self.x **= 2
505
506 @pysnooper.snoop(watch='foo', normalize=normalize, color=False)
507 def my_function():
508 foo = Foo()
509 for i in range(2):
510 foo.square()
511
512 with mini_toolbox.OutputCapturer(stdout=False,
513 stderr=True) as output_capturer:
514 result = my_function()
515 assert result is None
516 output = output_capturer.string_io.getvalue()
517 assert_output(
518 output,
519 (
520 SourcePathEntry(),
521 VariableEntry('Foo'),
522 CallEntry('def my_function():'),
523 LineEntry('foo = Foo()'),
524 VariableEntry('foo'),
525 LineEntry(),
526 VariableEntry('i', '0'),
527 LineEntry(),
528 LineEntry(),
529 VariableEntry('i', '1'),
530 LineEntry(),
531 LineEntry(),
532 ReturnEntry(),
533 ReturnValueEntry('None'),
534 ElapsedTimeEntry(),
535 ),
536 normalize=normalize,
537 )
538
539
540@pytest.mark.parametrize("normalize", (True, False))

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected