mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.6K
active users

#pytest

1 post1 participant0 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>
:rss: DevelopersIO<p>pytest + FreezeGunで日時モックを使ったテストコードを書く<br><a href="https://dev.classmethod.jp/articles/pytest-freezegun/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">dev.classmethod.jp/articles/py</span><span class="invisible">test-freezegun/</span></a></p><p><a href="https://rss-mstdn.studiofreesia.com/tags/dev_classmethod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dev_classmethod</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/small%E3%83%86%E3%82%B9%E3%83%88" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>smallテスト</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/%E5%8D%98%E4%BD%93%E3%83%86%E3%82%B9%E3%83%88" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>単体テスト</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>
:rss: DevelopersIO<p>pytestのmark.parametrizeでテストケースを識別しやすくする<br><a href="https://dev.classmethod.jp/articles/pytest-mark-parametrize-2/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">dev.classmethod.jp/articles/py</span><span class="invisible">test-mark-parametrize-2/</span></a></p><p><a href="https://rss-mstdn.studiofreesia.com/tags/dev_classmethod" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dev_classmethod</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/%E6%80%A7%E8%83%BD%E3%83%86%E3%82%B9%E3%83%88" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>性能テスト</span></a> <a href="https://rss-mstdn.studiofreesia.com/tags/small%E3%83%86%E3%82%B9%E3%83%88" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>smallテスト</span></a></p>
Wolf<p>Of course it would be better if it had <a href="https://hachyderm.io/tags/Tests" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Tests</span></a> (in <a href="https://hachyderm.io/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a>, I always use <a href="https://hachyderm.io/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a>). Sorry @BrianOkken.</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>
mgorny-nyan (on) :autism:🙀🚂🐧<p>A tak poza tym, to wysłałem parę łatek, by ulepszyć funkcję epytest w <a href="https://pol.social/tags/Gentoo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Gentoo</span></a>.</p><p>Wymuszają krótkie podsumowania, załączają tworzenie plików junit .xml, żeby ułatwić maszynowe przetwarzanie wyników, i — co najważniejsze — dodają&nbsp;zmienną EPYTEST_PLUGINS, żeby podawać, które wtyczki mają być załadowane. Będziemy dążyć do tego, by całkiem odejść od domyślnego automatycznego ładowania wtyczek.</p><p><a href="https://archives.gentoo.org/gentoo-dev/20250623184523.226345-1-mgorny@gentoo.org/T/#t" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">archives.gentoo.org/gentoo-dev</span><span class="invisible">/20250623184523.226345-1-mgorny@gentoo.org/T/#t</span></a></p><p><a href="https://pol.social/tags/PyTest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyTest</span></a> <a href="https://pol.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
mgorny-nyan (on) :autism:🙀🚂🐧<p>Wspaniały dzisiejszy <a href="https://pol.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a>: <a href="https://pol.social/tags/Gentoo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Gentoo</span></a> uruchamia testy w paczkach związanych z <a href="https://pol.social/tags/ProtoBuf" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ProtoBuf</span></a> z pomocą <a href="https://pol.social/tags/PyTest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyTest</span></a>-forked, żeby obejść segfaulty podczas GC.</p><p>Oczywiście, oznacza to, że zwykłe programy też mogą łapać segfaulty przy wyjściu.</p><p><a href="https://github.com/protocolbuffers/protobuf/issues/22067" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/protocolbuffers/pro</span><span class="invisible">tobuf/issues/22067</span></a><br><a href="https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/protobuf/protobuf-6.31.1.ebuild?id=54e20d4bb0ec99ab868695a2980c4307d179cb10#n150" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">gitweb.gentoo.org/repo/gentoo.</span><span class="invisible">git/tree/dev-python/protobuf/protobuf-6.31.1.ebuild?id=54e20d4bb0ec99ab868695a2980c4307d179cb10#n150</span></a></p>
mgorny-nyan (on) :autism:🙀🚂🐧<p>No więc co dziś robię zamiast odpocząć? Otóż, bawię się w generowanie EPYTEST_DESELECT z `epytest --junit-xml=…`</p><p><a href="https://github.com/gentoo/gentoo/pull/42606" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/gentoo/gentoo/pull/</span><span class="invisible">42606</span></a><br><a href="https://github.com/projg2/gpyutils/blob/master/gpyutils/scripts/junit2deselect.py" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/projg2/gpyutils/blo</span><span class="invisible">b/master/gpyutils/scripts/junit2deselect.py</span></a></p><p><a href="https://pol.social/tags/Gentoo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Gentoo</span></a> <a href="https://pol.social/tags/PyTest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyTest</span></a> <a href="https://pol.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
Aaron Longchamps<p>It's been a while since I've posted an update for Rack Root, but I've actually made some progress on it lately.</p><p>I've finished my refactor to use SQLAlchemy for the database connections and also (finally) figured out how I want to join tables together and relate things.</p><p>I also changed some API endpoints. For example, if you look for /network/$id/gateway and there's no gateway, you get a 404. I also changed the UX around gateways. When you make a new network, there's no gateway assigned, so that part of the page has a green + icon. When you set a gateway, that icon is now a red delete icon. Those update the field and icon dynamically without having to refresh the whole page.</p><p>The new networks page also will look at the result and see if you got an HTTP 201. If so, you get redirected to the new page. Else, you get an error message. I'm not sure if I want to add more detail to that, it would require the frontend to parse and guess what went wrong. Maybe that's an assignment for another day.</p><p>Finally, there's a new Delete network button on the network detail page.</p><p><a href="https://infosec.exchange/tags/rackroot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rackroot</span></a> <a href="https://infosec.exchange/tags/homelab" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>homelab</span></a> <a href="https://infosec.exchange/tags/vuetify" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vuetify</span></a> <a href="https://infosec.exchange/tags/fastapi" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fastapi</span></a> <a href="https://infosec.exchange/tags/sqlalchemy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sqlalchemy</span></a> <a href="https://infosec.exchange/tags/frontend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>frontend</span></a> <a href="https://infosec.exchange/tags/backend" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>backend</span></a> <a href="https://infosec.exchange/tags/fullstack" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>fullstack</span></a> <a href="https://infosec.exchange/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 (on) :autism:🙀🚂🐧<p>Paczki Pythona:</p><p>"A pamiętacie tę całkowicie przypadkową wtyczkę PyTesta, która nie jest rozwijana od 2018 roku, i którą musieliście dodać do <a href="https://pol.social/tags/Gentoo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Gentoo</span></a>, bo postanowiliśmy jej używać bez jakiegokolwiek powodu? No cóż, właśnie przestaliśmy. A tak przy okazji — właśnie udało nam się znaleźć&nbsp;kolejną wtyczkę, która po raz trzeci wynajduje na nowo obsługę niestabilnych testów. Miłej zabawy!"</p><p>(Szczęśliwie, jest dostatecznie kompatybilna z pytest-rerunfailures, żebym mógł ją zignorować.)</p><p><a href="https://pol.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://pol.social/tags/PyTest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyTest</span></a></p>
mgorny-nyan (on) :autism:🙀🚂🐧<p>Czy to nie super, kiedy okazuje się, że padający test w <a href="https://pol.social/tags/Twisted" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Twisted</span></a> (który najpewniej jest objawem prawdziwego błędu w kodzie) występuje tylko, jeżeli dodatkowo zainstalujemy <a href="https://pol.social/tags/Trio" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Trio</span></a>, <a href="https://pol.social/tags/PyTest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PyTest</span></a> oraz Py? Znaczy się, o ile dobrze to rozumiem, to Twisted importuje Trio, a błąd wynika z automatycznego łańcucha opcjalnych zależności Trio → PyTest → Py.</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://pol.social/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a></p>
Jumping Rivers<p>Writing good Python code isn't just about making it work — it's about making it reproducible, maintainable, and saving time in the long run.</p><p>In our latest blog post, we discuss advanced testing techniques with pytest, including parametrised tests, fixtures, mocking, and useful plugins.</p><p><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> <a href="https://fosstodon.org/tags/SoftwareDevelopment" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SoftwareDevelopment</span></a><br><a href="https://www.jumpingrivers.com/blog/python-testing-advanced/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">jumpingrivers.com/blog/python-</span><span class="invisible">testing-advanced/</span></a></p>
lachlan slowly taming rust<p>Unit testing instructions unclear - how do I include this in my Python program <br><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/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a></p>
James Bennett<p>A question for <a href="https://infosec.exchange/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> folks: when using <a href="https://infosec.exchange/tags/pytest" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pytest</span></a> fixtures, how do you prefer to provide arguments to a fixture?</p><p>If you're unsure what the options mean, the following posts will provide links explaining each one.</p>