Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
45 views

Python unit testing: function patch does not get applied to consumer that runs in a separate thread

I am trying to test a consumer that consumes messages of a queue and creates the corresponding object in salesforce. To test the consumer I have to start it in a new thread because, it is an infinite ...
Gill Mertens's user avatar
1 vote
0 answers
48 views

Why mock is not applied on a method which called within thread after testcase finishes

I have these two classes: one.py class One: def __init__(self) -> None: pass def startS(self): self._doS() def _doS(self): print("Inside doS ...
tatti's user avatar
  • 11
2 votes
1 answer
6k views

Mocking Thread module in python

I am trying to mock a function that uses multithreading to run another function with different parameters and saves the return results to the queue. I tried using pytest and unitest to mock it but it ...
Incognito's user avatar
  • 145