Skip to content

test(tracing): Simplify static/classmethod tracing tests #4278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

szokeasaurusrex
Copy link
Member

These tests were causing flakes where the mock method was being called more than once. The tests were also difficult to understand.

This change removes the need for mocking (hopefully increasing test stability) and also should hopefully make it easier to understand what these tests are meant to be checking

@szokeasaurusrex szokeasaurusrex requested a review from a team as a code owner April 10, 2025 13:42
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.52%. Comparing base (6000f87) to head (0f0eddb).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4278      +/-   ##
==========================================
- Coverage   79.54%   79.52%   -0.03%     
==========================================
  Files         142      142              
  Lines       15907    15907              
  Branches     2723     2723              
==========================================
- Hits        12654    12650       -4     
- Misses       2389     2390       +1     
- Partials      864      867       +3     

see 2 files with indirect coverage changes

@szokeasaurusrex
Copy link
Member Author

ah looks like there are some interactions between the tests here

@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/tracing-static-class-test-improvements branch from 742bd9f to 5348bf5 Compare April 10, 2025 18:32
These tests were causing flakes where the mock method was being called more than once. The tests were also difficult to understand.

This change removes the need for mocking (hopefully increasing test stability) and also should hopefully make it easier to understand what these tests are meant to be checking
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/tracing-static-class-test-improvements branch from 5348bf5 to 0f0eddb Compare April 10, 2025 18:42
@szokeasaurusrex szokeasaurusrex merged commit be22912 into master Apr 14, 2025
138 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/tracing-static-class-test-improvements branch April 14, 2025 08:16
szokeasaurusrex added a commit that referenced this pull request Apr 14, 2025
Port of #4278 for POTel.

<!-- Describe your PR here -->

---

Thank you for contributing to `sentry-python`! Please add tests to
validate your changes, and lint your code using `tox -e linters`.

Running the test suite on your PR might require maintainer approval.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants