Pytest.main() Capture Standard Output April 16, 2024 Post a Comment I have a method I am using to get all of the tests we have. def get_test_names_from_file(): get_test_names = pytest.main(['--collect-only', '-q']) print(type(get_test_namSolution 1: You could use py.io for this.something like:capture = py.io.StdCapture() pytest.main(['--collect-only', '-q']) std, err = capture.reset() print(std) CopyWould get you the standard output you're looking for. Share Post a Comment for "Pytest.main() Capture Standard Output"
Post a Comment for "Pytest.main() Capture Standard Output"