All Questions
Tagged with python-unittest.mock multithreading
3 questions
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 ...
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 ...
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 ...