diff --git a/ipatests/pytest_ipa/nose_compat.py b/ipatests/pytest_ipa/nose_compat.py index 2736ad5a8..f059f7c57 100644 --- a/ipatests/pytest_ipa/nose_compat.py +++ b/ipatests/pytest_ipa/nose_compat.py @@ -54,19 +54,11 @@ def pytest_configure(config): capture = config.pluginmanager.getplugin('capturemanager') orig_stdout, orig_stderr = sys.stdout, sys.stderr if capture: - if hasattr(capture, 'suspend_global_capture'): - # pytest >= 3.3 - capture.suspend_global_capture() - else: - # legacy support for pytest <= 3.2 (Fedora 27) - capture._capturing.suspend_capturing() + capture.suspend_global_capture() sys.stderr.write(self.format(record)) sys.stderr.write('\n') if capture: - if hasattr(capture, 'resume_global_capture'): - capture.resume_global_capture() - else: - capture._capturing.resume_capturing() + capture.resume_global_capture() sys.stdout, sys.stderr = orig_stdout, orig_stderr level = convert_log_level(config.getoption('logging_level'))