[lang-ref] ( print_with_format ) ( python )

def test_print_with_format(capsys):
    # print('%d' % i)
    # This isn’t really a print feature; it’s a string formatting feature.

    print('%s-%03d' % ('test', 2))

    captured = capsys.readouterr()
    assert captured.out == 'test-002\n'