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:

215
active users

#pytest

0 posts0 participants0 posts today

une bibliothèque pour mocker les ressources #AWS utilisées dans le code de production #Python que vous testez (S3, par exemple) : github.com/getmoto/moto

La page github.com/getmoto/moto/blob/m documente comment écrire les tests (#pytest, #unittest) 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).

GitHubGitHub - getmoto/moto: A library that allows you to easily mock out tests based on AWS infrastructure.A library that allows you to easily mock out tests based on AWS infrastructure. - getmoto/moto
Replied to John-Mark Gurney

@encthenet @rachelplusplus Dunno if you've considered this, or would consider it, but pytest has a plugin, pytest-fakefs (github.com/pytest-dev/pyfakefs), 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.

Or if you prefer, pytest also has built-in functionality that makes working with temporary files pretty easy.

GitHubGitHub - pytest-dev/pyfakefs: Provides a fake file system that mocks the Python file system modules.Provides a fake file system that mocks the Python file system modules. - pytest-dev/pyfakefs

Idle thought apropos of nothing specific:

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.

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.

I don't see a movement to merge pytest to the stdlib.

Isn't it awesome that a test failure in #Twisted (which probably indicates a real problem with the code) occurs only if you have additionally installed #Trio, #PyTest 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.

github.com/twisted/twisted/iss

GitHub`builtins.RuntimeError: dictionary changed size during iteration` in `twisted.python.rebuild.rebuild()` with parallel testing · Issue #12458 · twisted/twistedBy mgorny

Decentralizers, attention! :)

Last #deltachat releases introduced stable #p2p 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 #TLA+ (invented by Leslie Lamport of vector clock fame):

github.com/chatmail/models/tre

and a complementary #pytest model with more corner cases tested here:

github.com/chatmail/models/blo

GitHubmodels/group-membership at main · chatmail/modelsFormal specifications for chatmail. Contribute to chatmail/models development by creating an account on GitHub.

Dear @ThePSF ...

having been engaged with #Python through co-creating #pytest #pypy, 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: kpbs.org/news/border-immigrati

Maybe better update the #Pycon webpage accordingly?

Hey, #python / #django people: I dimly recall a tool that uses #coverage data to only run #pytest tests that impact changed lines of code, or changed methods/logical blocks of code.

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"

ring any bells? I found partialtesting (dead) and pytest-watch (spams *such* an amount of irrelevant messages in my project it's unusable, see github.com/joeyespo/pytest-wat)

GitHubLogging error when running pytest in pytest-watch · Issue #115 · joeyespo/pytest-watchBy YievCkim

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?