Skip to content

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

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
merged 1 commit into from
Apr 14, 2025

Conversation

szokeasaurusrex
Copy link
Member

Port of #4278 for POTel.


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.

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

codecov bot commented Apr 10, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
20655 1 20654 4419
View the top 1 failed test(s) by shortest run time
tests.integrations.django.test_cache_module test_cache_spans_get_span_description[get-args4-kwargs4-]
Stack Traces | 0.004s run time
.../integrations/django/test_cache_module.py:386: in test_cache_spans_get_span_description
    assert _get_span_description(method_name, args, kwargs) == expected_description
E   AssertionError: assert '1a\\ά\x18\x7f@w$,H]' == ''
E     + 1a\ά#x18Hň�@w$,H]

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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/potel-base/tracing-test branch from ff4f8e6 to fdf3fb8 Compare April 11, 2025 13:16
@szokeasaurusrex szokeasaurusrex merged commit e4f8f1f into potel-base Apr 14, 2025
127 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/potel-base/tracing-test branch April 14, 2025 08:16
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