python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Python unit test that nothing was executed
In a method that looks like:
def my_method(p):
if p == 5:
return
elif p == 6:
do_something()
return
else:
do_something_different()
return
How do I ...

Katu
Votes: 0
Answers: 1
Python3.9. I am trying to write an exception but get this error:TypeError: catching classes that do not inherit from BaseException is not allowed
What should I do to print something and continue running after catching the exception? How to do the best practice on that?
I am writing unit tests but first of all tried to test wrong query to DB Pos...
Robert
Votes: 0
Answers: 1
Mock entire client class with pytest
I have a class that inherits from another class in which we build a client:
class Client(ClientLibrary):
def __init__(self, hosts=[{'host':<HOST_ADDRESS>, 'port':<PORT>}], **kwargs):
...
tg295
Votes: 0
Answers: 0
Can I use side_effect in my mocking to provide an indefinite number of values?
So I can use an iterable with side_effect in python mock to produce changing values returned by my calls to the mock:
some_mock.side_effect = [1, 2, 3]
return_value provides the same value every time...
Jed Godsey
Votes: 0
Answers: 1