python-trio / trio

Trio – a friendly Python library for async concurrency and I/O
https://trio.readthedocs.io
Other
5.98k stars 325 forks source link

Ensure we're deterministic for Hypothesis in Trio, not pytest-trio #2985

Closed Zac-HD closed 2 months ago

Zac-HD commented 2 months ago

This registration was previously handled by pytest-trio (before Hypothesis supported entry-point plugins). Upstreaming it means that we'll get the behavior we want for unittest, for functions people call by hand, and so on. Fixes https://github.com/python-trio/trio/issues/2981. Manual testing with Hypothesis confirms this works, and our existing determinism-related unit tests continue to pass, so I haven't added more complicated tests which would require subprocesses and installing Hypothesis.

I'll open a PR to remove the relevant logic from pytest-trio once this has been released; double-registration is perfectly safe so it's better to overlap than leave a gap.

Plus some bonus updates to the awesome-trio-libraries page, since I noticed outdated information there.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 99.63%. Comparing base (564907b) to head (5cff076).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2985 +/- ## ========================================== - Coverage 99.64% 99.63% -0.02% ========================================== Files 117 117 Lines 17594 17598 +4 Branches 3171 3171 ========================================== + Hits 17532 17533 +1 - Misses 43 46 +3 Partials 19 19 ``` | [Files](https://app.codecov.io/gh/python-trio/trio/pull/2985?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio) | Coverage Δ | | |---|---|---| | [src/trio/\_core/\_run.py](https://app.codecov.io/gh/python-trio/trio/pull/2985?src=pr&el=tree&filepath=src%2Ftrio%2F_core%2F_run.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-trio#diff-c3JjL3RyaW8vX2NvcmUvX3J1bi5weQ==) | `99.34% <25.00%> (-0.33%)` | :arrow_down: |
A5rocks commented 2 months ago

I think the lost coverage is acceptable!