0
pytest capsys
fixture은 정말 유용하지만, 조명기로 포함될 때마다 즉시 모든 것을 캡처합니다. 테스트의 특정 라인 출력 만 캡처하고 싶습니다.명시 적으로 사용 가능한 capsys pytest 픽스쳐
def test_disabling_capturing(capsys):
print('this output is not captured')
with capsys.enabled():
print('output is captured')
print('this output is also not captured')
이 capsys 어떻게 든 조명기 가능합니다 : 그 반대 같은
def test_disabling_capturing(capsys):
print('this output is captured')
with capsys.disabled():
print('output not captured, going directly to sys.stdout')
print('this output is also captured')
하지만 내가 원하는 무엇인가 : 그것은 실제로 "장애인"컨텍스트를 제공 않습니다
?