-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding spans for setup, teardown, and individual fixtures (#26)
* Adding spans for setup, teardown, and individual fixtures In test suites with complex setups, teardowns, and fixtures, it's common to see most of the test runtime happening in those stages rather than in the individual tests themselves. In this change, session- and module-scoped fixtures are attributed to the overall test session, while function-scoped fixtures are attributed to the setup for an individual test. This will help with artificial skew from tests that happen to be the first ones that request a higher-scoped fixture. I'd welcome feedback on the layout of the spans after some folks have had time to try it out. `pytest` doesn't have a clearly defined session or module `setup` stage where these fixtures are run, because they are invoked lazily the first time a test requests them. This is ideal for performance, but these spans will end up kind of "hanging in mid-air" between other test suites. Depending on the visualization tool (OpenObserve, Jaeger, etc), you may see those higher-scoped fixture spans showing up in different spots. Thanks to @drcraig for the idea and @sihil for the cheers! Closes #25 * Adding Python 3.11 as a test target.
- Loading branch information
1 parent
7f0246c
commit 3a5f5e2
Showing
3 changed files
with
213 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters