Python Forum
Mock call to subprocess.Popen failing with StopIteration
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mock call to subprocess.Popen failing with StopIteration
#1
A unit test that I have inherited is now failing on

p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
logging.warning('Not hitting here.')
with a traceback of

Error:
File "/usr1/tsmith/miniconda3/lib/python3.7/unittest/mock.py", line 960, in __call__ return _mock_self._mock_call(*args, **kwargs) File "/usr1/tsmith/miniconda3/lib/python3.7/unittest/mock.py", line 1022, in _mock_call result = next(effect)
StopIteration`

Any idea how to investigate this?
Reply


Messages In This Thread
Mock call to subprocess.Popen failing with StopIteration - by tharpa - Nov-07-2019, 08:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Understanding subprocess.Popen Pedroski55 6 1,917 May-12-2024, 10:46 AM
Last Post: Pedroski55
  Failing to connect by 'net use' tester_V 1 1,043 Apr-20-2024, 06:31 AM
Last Post: tester_V
Information subprocess.Popen() suddenly giving me grief? davecotter 3 1,754 Dec-13-2023, 10:49 PM
Last Post: davecotter
  unittest.mock for an api key silver 3 2,241 Aug-29-2022, 03:52 PM
Last Post: ndc85430
  Failing regex tester_V 3 2,317 Aug-16-2022, 03:53 PM
Last Post: deanhystad
  Use subprocess.Popen and time.sleep chucky831 2 2,908 Aug-11-2022, 07:53 PM
Last Post: carecavoador
  Mock obj - How to call the side_effect every time during the run? pythonisbae 3 5,106 Mar-06-2022, 09:37 AM
Last Post: pythonisbae
  continue if 'subprocess.call' failes tester_V 11 9,181 Aug-26-2021, 12:16 AM
Last Post: tester_V
  Failing to connect to a host with WMI tester_V 6 6,090 Aug-10-2021, 06:25 PM
Last Post: tester_V
  printing out the contents aftre subprocess.call() Rakshan 3 3,926 Jul-30-2021, 08:27 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020