Код: Выделить всё
def test_function_1(instrumentation: dict[str, float]) -> None:
assert instrumentation['a'] > instrumentation['b']
def test_function_2(capsys) -> None:
print("Hello, pytest!")
captured = capsys.readouterr()
assert captured.out == "Hello, pytest!\n"
Код: Выделить всё
import tests
import pytest #
Подробнее здесь: [url]https://stackoverflow.com/questions/79181238/selectively-calling-test-functions-with-capsys[/url]