<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 17/03/2020 06:54, Sebastian Huber
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:28d11887-4e6b-f966-451f-78da23cc7416@embedded-brains.de">On
16/03/2020 20:26, Amar Takhar wrote:
<br>
<br>
<blockquote type="cite" style="color: #000000;">I should have also
added some of my own reasons why pytest is better for writing
<br>
tests in Python:
<br>
<br>
- Fantastic exception handling makes it far easier to debug
test and code.
<br>
PDB works seamlessly.
<br>
- Far less overhead in creating initial tests.
<br>
- Trivial fixture support
<br>
- Paramaterised tests -- this is incredibly essential /
useful.
<br>
<br>
Another feature that's not often mentioned is pytest discovers
tests all on its
<br>
own. You can put a test anywhere labled test_*.py and it will
work. You can
<br>
run pytest anywhere in the source as well.
<br>
<br>
The above are starkly different from unittest where these
features don't exist
<br>
or are difficult / have a large overhead to implement.
<br>
</blockquote>
What is your recommendation with respect to the use of
unittest.mock?
</blockquote>
<p>It seems that pytest recommends monkeypatch:</p>
<p><a class="moz-txt-link-freetext" href="https://docs.pytest.org/en/latest/monkeypatch.html">https://docs.pytest.org/en/latest/monkeypatch.html</a><br>
</p>
</body>
</html>