Skip to content

Commit 7a70428

Browse files
committed
capture: remove unneeded getattr
This attribute is set in __init__ and not deleted. Other methods do it already but this one wasn't updated.
1 parent a35800c commit 7a70428

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/_pytest/capture.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,8 @@ def resume_global_capture(self):
630630
self._global_capturing.resume_capturing()
631631

632632
def suspend_global_capture(self, in_=False):
633-
cap = getattr(self, "_global_capturing", None)
634-
if cap is not None:
635-
cap.suspend_capturing(in_=in_)
633+
if self._global_capturing is not None:
634+
self._global_capturing.suspend_capturing(in_=in_)
636635

637636
def suspend(self, in_=False):
638637
# Need to undo local capsys-et-al if it exists before disabling global capture.

0 commit comments

Comments
 (0)