Tests / announcements/tests.py
TestPostAnnouncements::test_skips_when_token_missing
First seen 1 month, 1 week ago in 0c23747
CI
github-actions:test
13 runs
Average
20 ms
median 17 ms
max 41 ms
max 41 ms
Phases
Setup 2 ms
Call 15 ms
Teardown 3 ms
Categories
Database 12 ms
Factories 0.08 ms
Test code 0.07 ms
Other (Mocking, Libraries, Unsampled, pytest) 9 ms
8 database queries per run
Needs 40 KB of memory (max 88 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
setup0.76 ms8.0%
__init____init__:-10.76 ms8.0%
call7 ms74.4%
TestPostAnnouncements.test_skips_when_token_missingannouncements/tests.py:92 status_post = self._run_at(dt.datetime(2026, 6, 1, 9, 0, tzinfo=dt.UTC))4 ms37.2%
TestPostAnnouncements._run_atannouncements/tests.py:42 call_command("postannouncements", *([] if dry_run else ["--no-dry-run"]))4 ms37.2%
call_commanddjango/core/management/__init__.py:1952 ms24.8%
RichCommand.executedjango_rich/management/__init__.py:342 ms24.8%
BaseCommand.executedjango/core/management/base.py:4662 ms24.8%
Command.handleannouncements/management/commands/postannouncements.py:26 due = list(Announcement.objects.filter(posted_at__isnull=True, post_at__lte=timezone.now()))1 ms12.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms12.4%
QuerySet.filterdjango/db/models/query.py:16761 ms12.4%
QuerySet._filter_or_excludedjango/db/models/query.py:16941 ms12.4%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:17041 ms12.4%
Command.handleannouncements/management/commands/postannouncements.py:40 if not settings.FEDIDEVS_BOT_ACCESS_TOKEN:1 ms12.4%
LazySettings.__getattr__django/conf/__init__.py:1271 ms12.4%
call_commanddjango/core/management/__init__.py:1221 ms12.4%
BaseCommand.create_parserdjango/core/management/base.py:3101 ms12.4%
CommandParser.__init__django/core/management/base.py:661 ms12.4%
ArgumentParser.__init__<stdlib>/argparse.py:20481 ms12.4%
gettext<stdlib>/gettext.py:6321 ms12.4%
dgettext<stdlib>/gettext.py:5931 ms12.4%
translation<stdlib>/gettext.py:5361 ms12.4%
find<stdlib>/gettext.py:5201 ms12.4%
exists<frozen genericpath>:201 ms12.4%
TransactionTestCase._pre_setupdjango/test/testcases.py:1167 cls._fixture_setup()1 ms12.4%
TestCase._fixture_setupdjango/test/testcases.py:14811 ms12.4%
TestCase._enter_atomicsdjango/test/testcases.py:13991 ms12.4%
Atomic.__enter__django/db/transaction.py:2231 ms12.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms12.4%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4001 ms12.4%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3671 ms12.4%
CursorWrapper.executedjango/db/backends/utils.py:791 ms12.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms12.4%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms12.4%
Cursor.executepsycopg/cursor.py:1131 ms12.4%
Connection.waitpsycopg/connection.py:4951 ms12.4%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms12.4%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:3121 ms12.4%
TestPostAnnouncements.setUpannouncements/tests.py:25 self.not_due = baker.make(1 ms12.4%
makemodel_bakery/baker.py:1751 ms12.4%
Baker.makemodel_bakery/baker.py:4541 ms12.4%
Baker._makemodel_bakery/baker.py:5421 ms12.4%
Baker.instancemodel_bakery/baker.py:6591 ms12.4%
Model.savedjango/db/models/base.py:9041 ms12.4%
Model.save_basedjango/db/models/base.py:9961 ms12.4%
Model._save_tabledjango/db/models/base.py:11991 ms12.4%
Model._do_insertdjango/db/models/base.py:12511 ms12.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms12.4%
QuerySet._insertdjango/db/models/query.py:21411 ms12.4%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19361 ms12.4%
CursorWrapper.executedjango/db/backends/utils.py:791 ms12.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms12.4%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms12.4%
Cursor.executepsycopg/cursor.py:1131 ms12.4%
Connection.waitpsycopg/connection.py:4951 ms12.4%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()1 ms12.4%
TestCase._fixture_teardowndjango/test/testcases.py:14981 ms12.4%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4951 ms12.4%
CursorWrapper.executedjango/db/backends/utils.py:791 ms12.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms12.4%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms12.4%
Cursor.executepsycopg/cursor.py:1131 ms12.4%
Connection.waitpsycopg/connection.py:4951 ms12.4%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms12.4%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:3181 ms12.4%
BaseCursor._set_resultspsycopg/_cursor_base.py:5351 ms12.4%
BaseCursor._select_current_resultpsycopg/_cursor_base.py:5251 ms12.4%
teardown2 ms17.6%
TestCase.tearDownClassdjango/test/testcases.py:1456 cls._rollback_atomics(cls.cls_atomics)2 ms17.6%
TestCase._rollback_atomicsdjango/test/testcases.py:14082 ms17.6%
Atomic.__exit__django/db/transaction.py:3072 ms17.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms17.6%
BaseDatabaseWrapper.rollbackdjango/db/backends/base/base.py:3372 ms17.6%
BaseDatabaseWrapper._rollbackdjango/db/backends/base/base.py:3082 ms17.6%
Connection.rollbackpsycopg/connection.py:3142 ms17.6%
Connection.waitpsycopg/connection.py:4952 ms17.6%
BaseConnection._rollback_genpsycopg/_connection_base.py:6172 ms17.6%
BaseConnection._exec_commandpsycopg/_connection_base.py:4742 ms17.6%
Estimated from 8 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
announcements/tests.py:25
self.not_due = baker.make(
TestPostAnnouncements.setUp
· Database
|
1 ms |
|
announcements/tests.py:42
call_command("postannouncements", *([] if dry_run else ["--no-dry-run"]))
TestPostAnnouncements._run_at
· Libraries
|
1 ms |
|
announcements/management/commands/postannouncements.py:26
due = list(Announcement.objects.filter(posted_at__isnull=True, post_at__lte=timezone.now()))
Command.handle
· Database
|
1 ms |
|
announcements/management/commands/postannouncements.py:40
if not settings.FEDIDEVS_BOT_ACCESS_TOKEN:
Command.handle
· Libraries
|
1 ms |
Fixtures
Exact setup time| _template_string_if_invalid_marker function | 0.03 ms |
| _dj_autoclear_mailbox function | 0.03 ms |
| _django_db_marker function | 0.03 ms |
| _django_isolate_apps function | 0.02 ms |
| _live_server_helper function | 0.02 ms |
| _django_set_urlconf function | 0.02 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.02 ms |
Database
8 queries · 3 msNo repeated queries.
Biggest pieces of work
|
call test body
announcements/tests.py:92
|
4 ms |
|
teardown tearDownClass
django/test/testcases.py:1456
|
2 ms |
|
call _pre_setup
django/test/testcases.py:1167
|
1 ms |
|
call setUp
announcements/tests.py:25
|
1 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
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 | 10 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 15 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 13 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 11 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 14 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 17 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 28 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 20 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 24 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 14 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 22 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 33 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 41 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 7 ms | Run |