MCPcopy
hub / github.com/pytest-dev/pytest / test_comments

Function test_comments

testing/code/test_source.py:434–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

432
433
434def test_comments() -> None:
435 source = '''def test():
436 "comment 1"
437 x = 1
438 # comment 2
439 # comment 3
440
441 assert False
442
443"""
444comment 4
445"""
446'''
447 for line in range(2, 6):
448 assert str(getstatement(line, source)) == " x = 1"
449 for line in range(6, 8):
450 assert str(getstatement(line, source)) == " assert False"
451 for line in range(8, 10):
452 assert str(getstatement(line, source)) == '"""\ncomment 4\n"""'
453
454
455def test_comment_in_statement() -> None:

Callers

nothing calls this directly

Calls 1

getstatementFunction · 0.85

Tested by

no test coverage detected