Skip to content

ref: fix test_exception_reporter_filter when run by itself #93729

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
Jun 17, 2025

Conversation

asottile-sentry
Copy link
Member

previously failing with:

___________________________________________________ TestNoSettingsInDebugView.test ___________________________________________________
tests/sentry/debug/utils/test_exception_reporter_filter.py:18: in test
    resp = self.client.get(reverse("error-500"))
.venv/lib/python3.13/site-packages/django/urls/base.py:98: in reverse
    resolved_url = resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
.venv/lib/python3.13/site-packages/django/urls/resolvers.py:749: in _reverse_with_prefix
    self._populate()
.venv/lib/python3.13/site-packages/django/urls/resolvers.py:548: in _populate
    for url_pattern in reversed(self.url_patterns):
.venv/lib/python3.13/site-packages/django/utils/functional.py:47: in __get__
    res = instance.__dict__[self.name] = self.func(instance)
.venv/lib/python3.13/site-packages/django/urls/resolvers.py:718: in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
.venv/lib/python3.13/site-packages/django/utils/functional.py:47: in __get__
    res = instance.__dict__[self.name] = self.func(instance)
.venv/lib/python3.13/site-packages/django/urls/resolvers.py:711: in urlconf_module
    return import_module(self.urlconf_name)
../../.local/share/sentry-devenv/pythons/3.13.1/python/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:1026: in exec_module
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
src/sentry/conf/urls.py:3: in <module>
    from sentry.web.urls import urlpatterns
src/sentry/web/urls.py:70: in <module>
    Error500View.as_view(),
.venv/lib/python3.13/site-packages/django/views/generic/base.py:114: in as_view
    view.__annotations__ = cls.dispatch.__annotations__
../../.local/share/sentry-devenv/pythons/3.13.1/python/lib/python3.13/unittest/mock.py:690: in __getattr__
    raise AttributeError(name)
E   AttributeError: __annotations__

@asottile-sentry asottile-sentry merged commit d321c3a into master Jun 17, 2025
62 checks passed
@asottile-sentry asottile-sentry deleted the asottile-exception-reporter-filter-test branch June 17, 2025 18:14
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #93729      +/-   ##
==========================================
- Coverage   88.03%   80.33%   -7.70%     
==========================================
  Files       10325    10326       +1     
  Lines      595795   595945     +150     
  Branches    23136    23136              
==========================================
- Hits       524503   478772   -45731     
- Misses      70799   116680   +45881     
  Partials      493      493              

andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
previously failing with:

```
___________________________________________________ TestNoSettingsInDebugView.test ___________________________________________________
tests/sentry/debug/utils/test_exception_reporter_filter.py:18: in test
    resp = self.client.get(reverse("error-500"))
.venv/lib/python3.13/site-packages/django/urls/base.py:98: in reverse
    resolved_url = resolver._reverse_with_prefix(view, prefix, *args, **kwargs)
.venv/lib/python3.13/site-packages/django/urls/resolvers.py:749: in _reverse_with_prefix
    self._populate()
.venv/lib/python3.13/site-packages/django/urls/resolvers.py:548: in _populate
    for url_pattern in reversed(self.url_patterns):
.venv/lib/python3.13/site-packages/django/utils/functional.py:47: in __get__
    res = instance.__dict__[self.name] = self.func(instance)
.venv/lib/python3.13/site-packages/django/urls/resolvers.py:718: in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
.venv/lib/python3.13/site-packages/django/utils/functional.py:47: in __get__
    res = instance.__dict__[self.name] = self.func(instance)
.venv/lib/python3.13/site-packages/django/urls/resolvers.py:711: in urlconf_module
    return import_module(self.urlconf_name)
../../.local/share/sentry-devenv/pythons/3.13.1/python/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:1026: in exec_module
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
src/sentry/conf/urls.py:3: in <module>
    from sentry.web.urls import urlpatterns
src/sentry/web/urls.py:70: in <module>
    Error500View.as_view(),
.venv/lib/python3.13/site-packages/django/views/generic/base.py:114: in as_view
    view.__annotations__ = cls.dispatch.__annotations__
../../.local/share/sentry-devenv/pythons/3.13.1/python/lib/python3.13/unittest/mock.py:690: in __getattr__
    raise AttributeError(name)
E   AttributeError: __annotations__
```

<!-- Describe your PR here. -->
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