eupolicy.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
This Mastodon server is a friendly and respectful discussion space for people working in areas related to EU policy. When you request to create an account, please tell us something about you.

Server stats:

221
active users

#pytest

0 posts0 participants0 posts today
openSUSE Linux<p>Tired of reinventing the wheel for container testing? See how the <a href="https://fosstodon.org/tags/pytest_container" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest_container</span></a> plugin simplifies testing <a href="https://fosstodon.org/tags/containers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>containers</span></a> with <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> in this <a href="https://fosstodon.org/tags/oSC25" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>oSC25</span></a> talk! No more plumbing; just define, connect, <a href="https://fosstodon.org/tags/test" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>test</span></a> and go. <a href="https://fosstodon.org/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://fosstodon.org/tags/DevOps" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DevOps</span></a> <a href="https://fosstodon.org/tags/openSUSE" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>openSUSE</span></a> <a href="https://youtu.be/kU9NS1FpfY8?si=qyjoR5zfMWI7qpY3" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">youtu.be/kU9NS1FpfY8?si=qyjoR5</span><span class="invisible">zfMWI7qpY3</span></a></p>
Python Rennes<p>une bibliothèque pour mocker les ressources <a href="https://social.breizhcamp.org/tags/AWS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AWS</span></a> utilisées dans le code de production <a href="https://social.breizhcamp.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> que vous testez (S3, par exemple) : <a href="https://github.com/getmoto/moto" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/getmoto/moto</span><span class="invisible"></span></a></p><p>La page <a href="https://github.com/getmoto/moto/blob/master/docs/docs/getting_started.rst" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/getmoto/moto/blob/m</span><span class="invisible">aster/docs/docs/getting_started.rst</span></a> documente comment écrire les tests (<a href="https://social.breizhcamp.org/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a>, <a href="https://social.breizhcamp.org/tags/unittest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>unittest</span></a>) et donne quelques conseils pour écrire du code de production plus facile à tester (en ce qui concerne les interactions avec boto3, le client vers les services AWS).</p>
John-Mark Gurney<p><span class="h-card" translate="no"><a href="https://techhub.social/@diazona" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>diazona</span></a></span></p><p><span class="h-card" translate="no"><a href="https://tech.lgbt/@rachelplusplus" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>rachelplusplus</span></a></span></p><p>That won't work. It says so in the docs:<br>&gt; pyfakefs will not work with Python libraries that use C libraries to access the file system.</p><p>Which is what numpy is doing. </p><p><a href="https://flyovercountry.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://flyovercountry.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://flyovercountry.social/tags/UnitTesting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>UnitTesting</span></a></p>
David Zaslavsky<p><span class="h-card" translate="no"><a href="https://flyovercountry.social/@encthenet" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>encthenet</span></a></span> <span class="h-card" translate="no"><a href="https://tech.lgbt/@rachelplusplus" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>rachelplusplus</span></a></span> Dunno if you've considered this, or would consider it, but pytest has a plugin, pytest-fakefs (<a href="https://github.com/pytest-dev/pyfakefs" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/pytest-dev/pyfakefs</span><span class="invisible"></span></a>), that implements an in-memory filesystem complete with file objects that you can use to test file handling code without having to put things on disk. IMO the plugin ecosystem for handling things like this is one of pytest's biggest advantages over unittest.</p><p>Or if you prefer, pytest also has built-in functionality that makes working with temporary files pretty easy.</p><p><a href="https://techhub.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://techhub.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://techhub.social/tags/UnitTesting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>UnitTesting</span></a></p>
openSUSE Linux<p>Today's morning sessions are on Uyuni, <a href="https://fosstodon.org/tags/Aeon" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Aeon</span></a> Desktop, <a href="https://fosstodon.org/tags/encryption" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>encryption</span></a> on <a href="https://fosstodon.org/tags/Steam" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Steam</span></a> Decks, <a href="https://fosstodon.org/tags/Kalpa" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Kalpa</span></a>, branding, <a href="https://fosstodon.org/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> for <a href="https://fosstodon.org/tags/containers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>containers</span></a>, <a href="https://fosstodon.org/tags/zypper" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>zypper</span></a> speed and more.! <a href="https://streaming.media.ccc.de/osc25" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">streaming.media.ccc.de/osc25</span><span class="invisible"></span></a></p>
Carlton Gibson<p>Idle thought apropos of nothing specific: </p><p>The very same folks telling me BOTH that I MUST use pytest, and that Django MUST have its JSON API story built-in continues to be ironic. </p><p>I'd (probably) at least open with the thought that testing is easily as central to a language as JSON APIs are to a web framework.</p><p>I don't see a movement to merge pytest to the stdlib. </p><p><a href="https://chaos.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://chaos.social/tags/Django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Django</span></a> <a href="https://chaos.social/tags/Pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pytest</span></a></p>
Agnès H.<p>Dites, la team <a href="https://framapiaf.org/tags/django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>django</span></a> <a href="https://framapiaf.org/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://framapiaf.org/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> : il me semble avoir vu passer la réf d'un package permettant de mocker les API tierces pour éviter de faire des appels réseau dans nos tests. Ça vous dit quelque chose ?</p>
Brian Okken :python:<p>Last chance to grab “Python Testing with pytest” at 40% off with code SPRING2025.<br>Expires June 3, 2025.<br><a href="https://pragprog.com/titles/bopytest2/python-testing-with-pytest-second-edition/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">pragprog.com/titles/bopytest2/</span><span class="invisible">python-testing-with-pytest-second-edition/</span></a><br><a href="https://fosstodon.org/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://fosstodon.org/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a></p>
mgorny-nyan (he) :autism:🙀🚂🐧<p>Isn't it awesome that a test failure in <a href="https://social.treehouse.systems/tags/Twisted" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Twisted</span></a> (which probably indicates a real problem with the code) occurs only if you have additionally installed <a href="https://social.treehouse.systems/tags/Trio" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Trio</span></a>, <a href="https://social.treehouse.systems/tags/PyTest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyTest</span></a> and Py? Like, my understanding is that Trio gets imported by Twisted, and via automagic optional import chain Trio → PyTest → Py, a bug gets triggered.</p><p><a href="https://github.com/twisted/twisted/issues/12458#issuecomment-2907855880" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/twisted/twisted/iss</span><span class="invisible">ues/12458#issuecomment-2907855880</span></a></p><p><a href="https://social.treehouse.systems/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
Yngve Mardal Moe 🐍🐢🪡<p>I'm adding resources for future reading for mine and Marie's <a href="https://fosstodon.org/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://fosstodon.org/tags/packaging" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>packaging</span></a> tutorial for <a href="https://fosstodon.org/tags/PyConUS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyConUS</span></a>, and I realised that I don't know any good <a href="https://fosstodon.org/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> tutorials for beginners. Does anyone have any reccommendations?</p>
David Zaslavsky<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@gagliardi_vale" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>gagliardi_vale</span></a></span> The <a href="https://techhub.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> documentation is also pretty decent, come to think of it: <a href="https://docs.pytest.org/en/stable/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">docs.pytest.org/en/stable/</span><span class="invisible"></span></a></p><p><a href="https://techhub.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
Delta Chat<p>Decentralizers, attention! :) </p><p>Last <a href="https://chaos.social/tags/deltachat" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>deltachat</span></a> releases introduced stable <a href="https://chaos.social/tags/p2p" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>p2p</span></a> group membership not found in any other messenger. Members can add/remove peers also while being offline, and when everything comes online again, everyone has the same consistent membership view. We formalized and ran a simulation model using <a href="https://chaos.social/tags/TLA" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TLA</span></a>+ (invented by Leslie Lamport of vector clock fame):</p><p><a href="https://github.com/chatmail/models/tree/main/group-membership" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/chatmail/models/tre</span><span class="invisible">e/main/group-membership</span></a></p><p>and a complementary <a href="https://chaos.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> model with more corner cases tested here:</p><p><a href="https://github.com/chatmail/models/blob/main/gmc/test_gmc.py" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/chatmail/models/blo</span><span class="invisible">b/main/gmc/test_gmc.py</span></a></p>
holga<p>Dear <span class="h-card" translate="no"><a href="https://fosstodon.org/@ThePSF" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>ThePSF</span></a></span> ...</p><p>having been engaged with <a href="https://chaos.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> through co-creating <a href="https://chaos.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://chaos.social/tags/pypy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pypy</span></a>, giving talks and trainings i appreciate that the PSF has long been a champion of diversity and inclusion! Are you aware that these days many non-USians are canceling their US travels? The German foreign ministry warns about travel to the US if you are pregnant or don't have your passport carrying a birth gender marker, then this: <a href="https://www.kpbs.org/news/border-immigration/2025/02/28/german-tourist-held-indefinitely-in-san-diego-area-immigrant-detention-facility" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">kpbs.org/news/border-immigrati</span><span class="invisible">on/2025/02/28/german-tourist-held-indefinitely-in-san-diego-area-immigrant-detention-facility</span></a> </p><p>Maybe better update the <a href="https://chaos.social/tags/Pycon" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pycon</span></a> webpage accordingly?</p>
David Zaslavsky<p><span class="h-card" translate="no"><a href="https://mstdn.social/@WillyECoyote69" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>WillyECoyote69</span></a></span> Definitely pytest, if you ask me. pytest is by far my favorite testing framework out of all the ones I've used across different programming languages.</p><p>Unless using things outside the standard library is a huge burden for you, of course, but that's rarely the case.</p><p><a href="https://techhub.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://techhub.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a></p>
rixx<p>Hey, <a href="https://chaos.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> / <a href="https://chaos.social/tags/django" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>django</span></a> people: I dimly recall a tool that uses <a href="https://chaos.social/tags/coverage" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>coverage</span></a> data to only run <a href="https://chaos.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> tests that impact changed lines of code, or changed methods/logical blocks of code.</p><p>Like: "User.get_display_name was changed, and coverage data shows that these 15 tests test this method directly or indirectly, so only run those"</p><p>ring any bells? I found partialtesting (dead) and pytest-watch (spams *such* an amount of irrelevant messages in my project it's unusable, see <a href="https://github.com/joeyespo/pytest-watch/issues/115" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/joeyespo/pytest-wat</span><span class="invisible">ch/issues/115</span></a>)</p>
Sharlatan<p>Hi <a href="https://mastodon.social/tags/golang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>golang</span></a> , is there a similar test runner like <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> 's <a href="https://mastodon.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a>?</p>
Hugo van Kemenade<p>Oh, and taking inspiration from <a class="hashtag" href="https://bsky.app/search?q=%23pytest" rel="nofollow noopener" target="_blank">#pytest</a>, I added colour to <a class="hashtag" href="https://bsky.app/search?q=%23unittest" rel="nofollow noopener" target="_blank">#unittest</a> output in this one 🎨 <a href="https://docs.python.org/3.14/whatsnew/3.14.html#unittest" rel="nofollow noopener" target="_blank">docs.python.org/3.14/whatsne...</a> <a class="hashtag" href="https://bsky.app/search?q=%23Python" rel="nofollow noopener" target="_blank">#Python</a> <a class="hashtag" href="https://bsky.app/search?q=%23CPython" rel="nofollow noopener" target="_blank">#CPython</a> <a class="hashtag" href="https://bsky.app/search?q=%23Python314" rel="nofollow noopener" target="_blank">#Python314</a> <a class="hashtag" href="https://bsky.app/search?q=%23release" rel="nofollow noopener" target="_blank">#release</a></p>
Hugo van Kemenade<p>Oh, and taking inspiration from <a href="https://mastodon.social/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a>, I added colour to <a href="https://mastodon.social/tags/unittest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>unittest</span></a> output in this one 🎨</p><p><a href="https://docs.python.org/3.14/whatsnew/3.14.html#unittest" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">docs.python.org/3.14/whatsnew/</span><span class="invisible">3.14.html#unittest</span></a></p><p> <a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/CPython" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPython</span></a> <a href="https://mastodon.social/tags/Python314" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python314</span></a> <a href="https://mastodon.social/tags/release" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>release</span></a></p>
Ned Batchelder<p>Some nice <a href="https://hachyderm.io/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> techniques here as <span class="h-card" translate="no"><a href="https://fosstodon.org/@brianokken" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>brianokken</span></a></span> updates my "Testing some tidbits" post: <a href="https://pythontest.com/pytest/testing-tidbits-pytest/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">pythontest.com/pytest/testing-</span><span class="invisible">tidbits-pytest/</span></a></p>
HMF<p>Anybody got recs for good introductory resources on writing tests in Python? Not just stuff like pytest syntax and whatnot, but actual good practices, thorough overview of commonly accepted testing principles, and some real life examples?</p><p><a href="https://weirder.earth/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://weirder.earth/tags/Testing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Testing</span></a> <a href="https://weirder.earth/tags/Pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pytest</span></a> <a href="https://weirder.earth/tags/PythonTesting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PythonTesting</span></a> <a href="https://weirder.earth/tags/Programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Programming</span></a> <a href="https://weirder.earth/tags/PythonProgramming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PythonProgramming</span></a></p>