From 7a704288df8ed2d416c6dd8b15df3664ad425a5a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 17 Apr 2020 22:52:09 +0300 Subject: [PATCH] capture: remove unneeded getattr This attribute is set in __init__ and not deleted. Other methods do it already but this one wasn't updated. --- src/_pytest/capture.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 32e83dd21..64f4b8b92 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -630,9 +630,8 @@ class CaptureManager: self._global_capturing.resume_capturing() def suspend_global_capture(self, in_=False): - cap = getattr(self, "_global_capturing", None) - if cap is not None: - cap.suspend_capturing(in_=in_) + if self._global_capturing is not None: + self._global_capturing.suspend_capturing(in_=in_) def suspend(self, in_=False): # Need to undo local capsys-et-al if it exists before disabling global capture.