Tests / mastodon_auth/tests.py
MastodonAuthCallbackTests::test_token_exchange_failure_without_token_errors
First seen 5 months, 1 week ago in fcb1b79
CI
github-actions:test
13 runs
Average
97 ms
median 88 ms
max 202 ms
max 202 ms
Phases
Setup 1 ms
Call 96 ms
Teardown 0.37 ms
Categories
Database 7 ms
Other (Mocking, Cache, pytest, Unsampled, ...) 91 ms
8 database queries per run
Needs 601 KB of memory (max 1 MB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
call58 ms98.6%
MastodonAuthCallbackTests.test_token_exchange_failure_without_token_errorsmastodon_auth/tests.py:606 response = self.client.get("/mastodon_auth/", {"code": "abc", "state": state})52 ms88.4%
Client.getdjango/test/client.py:113352 ms88.4%
RequestFactory.getdjango/test/client.py:47552 ms88.4%
RequestFactory.genericdjango/test/client.py:67152 ms88.4%
Client.requestdjango/test/client.py:109152 ms88.4%
ClientHandler.__call__django/test/client.py:17350 ms85.0%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6349 ms83.3%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10449 ms83.3%
WhiteNoise.add_fileswhitenoise/base.py:10849 ms83.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12042 ms71.4%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13141 ms69.7%
WhiteNoise.get_static_filewhitenoise/base.py:21733 ms56.1%
StaticFile.__init__whitenoise/responders.py:779 ms15.3%
StaticFile.get_alternativeswhitenoise/responders.py:2003 ms5.1%
__init____init__:-13 ms5.1%
Headers.__init__<stdlib>/wsgiref/headers.py:442 ms3.4%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms3.4%
Headers.__init__<stdlib>/wsgiref/headers.py:431 ms1.7%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:491 ms1.7%
StaticFile.get_alternativeswhitenoise/responders.py:2063 ms5.1%
compile<stdlib>/re/__init__.py:2911 ms1.7%
_compile<stdlib>/re/__init__.py:3371 ms1.7%
StaticFile.get_alternativeswhitenoise/responders.py:2013 ms5.1%
Headers.__setitem__<stdlib>/wsgiref/headers.py:623 ms5.1%
Headers.__delitem__<stdlib>/wsgiref/headers.py:712 ms3.4%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:501 ms1.7%
Headers.__delitem__<stdlib>/wsgiref/headers.py:721 ms1.7%
StaticFile.__init__whitenoise/responders.py:728 ms13.6%
StaticFile.get_file_statswhitenoise/responders.py:1618 ms13.6%
__init____init__:-18 ms13.6%
FileEntry.__init__whitenoise/responders.py:2637 ms11.9%
FileEntry.stat_regular_filewhitenoise/responders.py:2765 ms8.5%
<GC>~5 ms8.5%
FileEntry.stat_regular_filewhitenoise/responders.py:2741 ms1.7%
FileEntry.__init__whitenoise/responders.py:2641 ms1.7%
StaticFile.__init__whitenoise/responders.py:747 ms11.9%
parsedate<stdlib>/email/_parseaddr.py:1856 ms10.2%
parsedate_tz<stdlib>/email/_parseaddr.py:506 ms10.2%
_parsedate_tz<stdlib>/email/_parseaddr.py:1211 ms1.7%
_parsedate_tz<stdlib>/email/_parseaddr.py:1631 ms1.7%
_parsedate_tz<stdlib>/email/_parseaddr.py:1801 ms1.7%
_parsedate_tz<stdlib>/email/_parseaddr.py:691 ms1.7%
StaticFile.__init__whitenoise/responders.py:737 ms11.9%
StaticFile.get_headerswhitenoise/responders.py:1783 ms5.1%
parsedate<stdlib>/email/_parseaddr.py:1853 ms5.1%
parsedate_tz<stdlib>/email/_parseaddr.py:503 ms5.1%
_parsedate_tz<stdlib>/email/_parseaddr.py:1051 ms1.7%
_parsedate_tz<stdlib>/email/_parseaddr.py:1721 ms1.7%
_parsedate_tz<stdlib>/email/_parseaddr.py:1171 ms1.7%
StaticFile.get_headerswhitenoise/responders.py:1771 ms1.7%
StaticFile.get_headerswhitenoise/responders.py:1761 ms1.7%
Headers.__setitem__<stdlib>/wsgiref/headers.py:641 ms1.7%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:501 ms1.7%
StaticFile.get_headerswhitenoise/responders.py:1671 ms1.7%
__init____init__:-11 ms1.7%
Headers.__init__<stdlib>/wsgiref/headers.py:431 ms1.7%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:491 ms1.7%
StaticFile.get_headerswhitenoise/responders.py:1811 ms1.7%
StaticFile.__init__whitenoise/responders.py:751 ms1.7%
Headers.__getitem__<stdlib>/wsgiref/headers.py:831 ms1.7%
Headers.get<stdlib>/wsgiref/headers.py:1041 ms1.7%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:461 ms1.7%
StaticFile.__init__whitenoise/responders.py:761 ms1.7%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1881 ms1.7%
Headers.__contains__<stdlib>/wsgiref/headers.py:871 ms1.7%
Headers.get<stdlib>/wsgiref/headers.py:1061 ms1.7%
WhiteNoise.get_static_filewhitenoise/base.py:2126 ms10.2%
WhiteNoise.add_cache_headerswhitenoise/base.py:2336 ms10.2%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1764 ms6.8%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1974 ms6.8%
URLMixin.urldebug_toolbar/panels/staticfiles.py:203 ms5.1%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2353 ms5.1%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:2162 ms3.4%
FileSystemStorage.urldjango/core/files/storage/filesystem.py:2042 ms3.4%
filepath_to_uridjango/utils/encoding.py:2451 ms1.7%
quote<stdlib>/urllib/parse.py:10661 ms1.7%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:2041 ms1.7%
LazyObject.__getattribute__django/utils/functional.py:2801 ms1.7%
URLMixin.urldebug_toolbar/panels/staticfiles.py:261 ms1.7%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1732 ms3.4%
WhiteNoiseMiddleware.get_name_without_hashwhitenoise/middleware.py:1912 ms3.4%
splitext<frozen posixpath>:1261 ms1.7%
_splitext<frozen genericpath>:1851 ms1.7%
WhiteNoise.get_static_filewhitenoise/base.py:2112 ms3.4%
WhiteNoise.add_mime_headerswhitenoise/base.py:2302 ms3.4%
Headers.add_header<stdlib>/wsgiref/headers.py:1922 ms3.4%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1231 ms1.7%
WhiteNoise.is_compressed_variantwhitenoise/base.py:1981 ms1.7%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1155 ms8.5%
scantreewhitenoise/base.py:2715 ms8.5%
scantreewhitenoise/base.py:2714 ms6.8%
scantreewhitenoise/base.py:2712 ms3.4%
scantreewhitenoise/base.py:2712 ms3.4%
scantreewhitenoise/base.py:2712 ms3.4%
scantreewhitenoise/base.py:2732 ms3.4%
scantreewhitenoise/base.py:2731 ms1.7%
scantreewhitenoise/base.py:2691 ms1.7%
scantreewhitenoise/base.py:2731 ms1.7%
BaseHandler.load_middlewaredjango/core/handlers/base.py:971 ms1.7%
convert_exception_to_responsedjango/core/handlers/exception.py:381 ms1.7%
iscoroutinefunction<stdlib>/inspect.py:3361 ms1.7%
_has_code_flag<stdlib>/inspect.py:2991 ms1.7%
_signature_is_functionlike<stdlib>/inspect.py:21011 ms1.7%
ClientHandler.__call__django/test/client.py:1862 ms3.4%
BaseHandler.get_responsedjango/core/handlers/base.py:1422 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1232 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1452 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3802 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:562 ms3.4%
BaseHandler._get_responsedjango/core/handlers/base.py:1992 ms3.4%
authmastodon_auth/views.py:303 logger.exception("login log_in api error for %s", instance.url)2 ms3.4%
Logger.exception<stdlib>/logging/__init__.py:15632 ms3.4%
Logger.error<stdlib>/logging/__init__.py:15572 ms3.4%
Logger._log<stdlib>/logging/__init__.py:16732 ms3.4%
Logger.handle<stdlib>/logging/__init__.py:16892 ms3.4%
Logger.callHandlers<stdlib>/logging/__init__.py:17492 ms3.4%
Handler.handle<stdlib>/logging/__init__.py:10302 ms3.4%
StreamHandler.emit<stdlib>/logging/__init__.py:11542 ms3.4%
Handler.format<stdlib>/logging/__init__.py:10022 ms3.4%
Formatter.format<stdlib>/logging/__init__.py:7152 ms3.4%
Formatter.formatMessage<stdlib>/logging/__init__.py:6842 ms3.4%
TransactionTestCase._pre_setupdjango/test/testcases.py:1167 cls._fixture_setup()2 ms3.4%
TestCase._fixture_setupdjango/test/testcases.py:14812 ms3.4%
TestCase._enter_atomicsdjango/test/testcases.py:13992 ms3.4%
Atomic.__enter__django/db/transaction.py:2232 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.4%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:3902 ms3.4%
BaseDatabaseWrapper._savepoint_alloweddjango/db/backends/base/base.py:3792 ms3.4%
MastodonAuthCallbackTests.test_token_exchange_failure_without_token_errorsmastodon_auth/tests.py:592 instance = Instance.objects.create(1 ms1.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms1.7%
QuerySet.createdjango/db/models/query.py:7361 ms1.7%
Model.savedjango/db/models/base.py:9041 ms1.7%
Model.save_basedjango/db/models/base.py:9961 ms1.7%
Model._save_tabledjango/db/models/base.py:11991 ms1.7%
Model._do_insertdjango/db/models/base.py:12511 ms1.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms1.7%
QuerySet._insertdjango/db/models/query.py:21411 ms1.7%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19361 ms1.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms1.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms1.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms1.7%
Cursor.executepsycopg/cursor.py:1131 ms1.7%
Connection.waitpsycopg/connection.py:4951 ms1.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms1.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms1.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms1.7%
MastodonAuthCallbackTests.test_token_exchange_failure_without_token_errorsmastodon_auth/tests.py:603 mastodon.log_in.side_effect = MastodonAPIError("nope")1 ms1.7%
NonCallableMock.__getattr__<stdlib>/unittest/mock.py:7171 ms1.7%
NonCallableMock._get_child_mock<stdlib>/unittest/mock.py:10971 ms1.7%
MagicMixin.__init__<stdlib>/unittest/mock.py:21861 ms1.7%
MagicMixin._mock_set_magics<stdlib>/unittest/mock.py:22091 ms1.7%
_patch.decoration_helper<stdlib>/unittest/mock.py:1416 with contextlib.ExitStack() as exit_stack:1 ms1.7%
_patch.__exit__<stdlib>/unittest/mock.py:16501 ms1.7%
Estimated from 58 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
mastodon_auth/tests.py:606
response = self.client.get("/mastodon_auth/", {"code": "abc", "state": state})
MastodonAuthCallbackTests.test_token_exchange_failure_without_token_errors
· Mocking
|
50 ms |
|
mastodon_auth/views.py:303
logger.exception("login log_in api error for %s", instance.url)
auth
· Mocking
|
2 ms |
|
mastodon_auth/tests.py:592
instance = Instance.objects.create(
MastodonAuthCallbackTests.test_token_exchange_failure_without_token_errors
· Database
|
1 ms |
|
mastodon_auth/tests.py:603
mastodon.log_in.side_effect = MastodonAPIError("nope")
MastodonAuthCallbackTests.test_token_exchange_failure_without_token_errors
· Mocking
|
1 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.04 ms |
| _template_string_if_invalid_marker function | 0.03 ms |
| _django_db_marker function | 0.03 ms |
| _django_isolate_apps function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_set_urlconf function | 0.02 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.01 ms |
Database
8 queries · 2 msNo repeated queries.
Biggest pieces of work
|
call test body
mastodon_auth/tests.py:606
|
54 ms |
|
call _pre_setup
django/test/testcases.py:1167
|
2 ms |
|
call decoration_helper
<stdlib>/unittest/mock.py:1416
|
1 ms |
| call pytest internals | 1 ms |
Reliability
14 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 14 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 2 weeks ago | CI github-actions:test | passed | 59 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 88 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 101 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 51 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 105 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 80 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 60 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 94 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 72 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 54 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 121 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 180 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 202 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 76 ms | Run |