Tests / announcements/tests.py
TestPostAnnouncements::test_records_error_and_leaves_row_unposted
First seen 1 month, 1 week ago in 0c23747
CI
github-actions:test
13 runs
Average
18 ms
median 17 ms
max 31 ms
max 31 ms
Phases
Setup 1 ms
Call 17 ms
Teardown 0.35 ms
Categories
Database 9 ms
Factories 0.18 ms
Other (Unsampled, Libraries, Mocking, pytest, ...) 8 ms
10 database queries per run
Needs 50 KB of memory (max 64 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
setup0.59 ms7.0%
call8 ms91.2%
TestPostAnnouncements.test_records_error_and_leaves_row_unpostedannouncements/tests.py:83 self._run_at(dt.datetime(2026, 6, 1, 9, 0, tzinfo=dt.UTC), status_post=failing)4 ms45.6%
TestPostAnnouncements._run_atannouncements/tests.py:42 call_command("postannouncements", *([] if dry_run else ["--no-dry-run"]))4 ms45.6%
call_commanddjango/core/management/__init__.py:1953 ms30.4%
RichCommand.executedjango_rich/management/__init__.py:343 ms30.4%
BaseCommand.executedjango/core/management/base.py:4663 ms30.4%
Command.handleannouncements/management/commands/postannouncements.py:47 mastodon = Mastodon(1 ms15.2%
CallableMixin.__call__<stdlib>/unittest/mock.py:11741 ms15.2%
Command.handleannouncements/management/commands/postannouncements.py:67 self.console.print("Done announcing 🎉")1 ms15.2%
Console.printrich/console.py:17051 ms15.2%
Console._collect_renderablesrich/console.py:15601 ms15.2%
Console.render_strrich/console.py:14641 ms15.2%
Highlighter.__call__rich/highlighter.py:381 ms15.2%
RegexHighlighter.highlightrich/highlighter.py:771 ms15.2%
Text.highlight_regexrich/text.py:6181 ms15.2%
call_commanddjango/core/management/__init__.py:1731 ms15.2%
CommandParser.parse_argsdjango/core/management/base.py:741 ms15.2%
ArgumentParser.parse_args<stdlib>/argparse.py:21491 ms15.2%
ArgumentParser.parse_known_args<stdlib>/argparse.py:21591 ms15.2%
ArgumentParser._parse_known_args2<stdlib>/argparse.py:21761 ms15.2%
TestPostAnnouncements.setUpannouncements/tests.py:18 self.due = baker.make(1 ms15.2%
makemodel_bakery/baker.py:1751 ms15.2%
Baker.makemodel_bakery/baker.py:4541 ms15.2%
Baker._makemodel_bakery/baker.py:5421 ms15.2%
Baker.instancemodel_bakery/baker.py:6591 ms15.2%
Model.savedjango/db/models/base.py:9041 ms15.2%
Model.save_basedjango/db/models/base.py:9961 ms15.2%
Model._save_tabledjango/db/models/base.py:11991 ms15.2%
Model._do_insertdjango/db/models/base.py:12511 ms15.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms15.2%
QuerySet._insertdjango/db/models/query.py:21411 ms15.2%
TestPostAnnouncements.setUpannouncements/tests.py:25 self.not_due = baker.make(1 ms15.2%
makemodel_bakery/baker.py:1751 ms15.2%
Baker.makemodel_bakery/baker.py:4541 ms15.2%
Baker._makemodel_bakery/baker.py:5421 ms15.2%
Baker.instancemodel_bakery/baker.py:6591 ms15.2%
Model.savedjango/db/models/base.py:9041 ms15.2%
Model.save_basedjango/db/models/base.py:9961 ms15.2%
Model._save_tabledjango/db/models/base.py:11991 ms15.2%
Model._do_insertdjango/db/models/base.py:12511 ms15.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms15.2%
QuerySet._insertdjango/db/models/query.py:21411 ms15.2%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()1 ms15.2%
TestCase._fixture_teardowndjango/test/testcases.py:14971 ms15.2%
TestCase._should_check_constraintsdjango/test/testcases.py:15061 ms15.2%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:5041 ms15.2%
Cursor.executepsycopg/cursor.py:1131 ms15.2%
Connection.waitpsycopg/connection.py:4951 ms15.2%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms15.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms15.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms15.2%
Estimated from 7 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
announcements/tests.py:18
self.due = baker.make(
TestPostAnnouncements.setUp
· Database
|
1 ms |
|
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:47
mastodon = Mastodon(
Command.handle
· Mocking
|
1 ms |
|
announcements/management/commands/postannouncements.py:67
self.console.print("Done announcing 🎉")
Command.handle
· Libraries
|
1 ms |
Fixtures
Exact setup time| _django_db_marker function | 0.03 ms |
| _template_string_if_invalid_marker function | 0.03 ms |
| _dj_autoclear_mailbox function | 0.03 ms |
| _django_isolate_apps function | 0.03 ms |
| _django_set_urlconf function | 0.02 ms |
| _live_server_helper function | 0.02 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.01 ms |
Database
10 queries · 2 msNo repeated queries.
Biggest pieces of work
|
call test body
announcements/tests.py:83
|
4 ms |
|
call setUp
announcements/tests.py:18
|
3 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
1 ms |
| setup pytest internals | 0.59 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 | 8 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 22 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 15 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 17 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 16 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 11 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 30 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 12 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 20 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 | 18 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 21 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 31 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 10 ms | Run |