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

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

Formal specifications for chatmail. Contribute to chatmail/models development by creating an account on GitHub.
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?

pytest-check 2.5.0 released.
It's gotten some recent attention from the community and I'm very grateful.
Thanks mfulgo for adding type hints. Super awesome.
And thanks to taylermulligan for fixing a longtime issue that we weren't respecting --runxfail.
github.com/okken/pytest-check
#Python #pytest

GitHubGitHub - okken/pytest-check: A pytest plugin that allows multiple failures per test.A pytest plugin that allows multiple failures per test. - okken/pytest-check

New blog post!

This time it's my first post about slightly advanced programming in Python. I talk about using the dependency injection design pattern to separate business logic from I/O calls to have cleaner code and simpler tests.

Well, actually the topic is more generic and can be applied to any programming language, but here I use Python as an example.

Anyway, here it is!

stfn.pl/blog/62-python-depende

stfn.plPython: Dependency injection for cleaner I/O handling
More from stfn :raspberrypi: :python:

pytest-mock : Mocking in pytest
Test & Code episode
testandcode.com/episodes/pytes
- Why the pytest-mock plugin is awesome
- Mocking, patching, monkeypatching
- Mocks, fakes, stubs and spies
- Why do we need these for testing
- pytest-mock as a curated wrapper around unittest.mock
#Python #pytest #mock

Test & CodeTest & Code | pytest-mock : Mocking in pytestpytest-mock is currently the #3 pytest plugin. pytest-mock is a wrapper around unittest.mock.In this episode:Why the pytest-mock plugin is awesomeWhat is mocking, patching, and monkey patchingWhat,...

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

If your program is leaking memory (or CUDA memory, or file descriptors, or really any limited resource), one way to identify the problem is to use your test suite to identify specific problem APIs. I demonstrate this using pytest fixtures:

pythonspeed.com/articles/ident

Python⇒Speed · Catching memory leaks with your test suiteIf you have a good test suite, you may be able use pytest fixtures to identify memory and other resource leaks.

This might be obvious but just in case: if #pytest reports a test failures like:


=========================== short test summary info ============================
FAILED tests/component/deb/test_import_orig.py::TestImportOrig::test_uscan - AssertionError: assert 1 == 0
+ …whatever failed …
FAILED another/failure

Then you can run that single test by invoking pytest with the bits after FAILED and before -, e.g. here:

pytest tests/component/deb/test_import_orig.py::TestImportOrig::test_uscan