gabriel / musehub public
fix BREAKING task/remove-anyio-marks #2 / 2
gabriel · 169 days ago · Apr 11, 2026 · Diff

fix: remove @pytest.mark.anyio from all test files

asyncio_mode = auto in pyproject.toml makes the mark redundant. Having it alongside pytest-asyncio fixtures (db_session) causes teardown to fail with 'Task got Future attached to a different loop' because anyio creates its own event loop that conflicts with pytest-asyncio's loop during fixture cleanup.

Removed from 85 test files (decorator and pytestmark = ... forms). Fixes test doubling (PASSED then ERROR), teardown failures, and the suite-wide freeze caused by leaked asyncpg connections.

sha256:8d27b86a45e0ccaa37f75b8cffe41b0413fbd38a2bb06e02169e2a45d54cb547 sha
+30 ~1944 −32 symbols
sha256:5a68f0c23ff7f0fb85e705f9628d779d30cc8a01d65581eb812cb9e16e05d20a snapshot
+30
symbols added
~1944
symbols modified
−32
symbols removed
0
dead code introduced
Semantic Changes 2006 symbols
~ tests/test_canary.py .py 1 symbol added
+ test_hello function function test_hello L1–2
~ tests/test_api_snapshots.py .py 45 symbols modified
~ tests/test_auth_authorization_section12.py .py 2 symbols added, 1 symbol removed, 6 symbols modified
− setup_method method method setup_method L113–115
+ _db_no_collab function function _db_no_collab L35–41
+ AsyncMock import import AsyncMock L15–15
~ tests/test_collaborators_section27.py .py 59 symbols modified
~ tests/test_context_section23.py .py 53 symbols modified
~ tests/test_cross_repo_section24.py .py 45 symbols modified
~ tests/test_domains_section25.py .py 62 symbols modified
~ tests/test_gc_background_tasks_section41.py .py 5 symbols added, 22 symbols removed, 5 symbols modified
− test_build_symbol_index_async_swallows_service_error method async_method test_build_symbol_index_async_swallows_service_error L341–347
− test_create_task_swallows_gc_failure method async_method test_create_task_swallows_gc_failure L349–356
− test_multiple_background_tasks_fire_and_forget method async_method test_multiple_background_tasks_fire_and_forget L358–367
− test_run_gc_async_completes_on_real_db method async_method test_run_gc_async_completes_on_real_db L322–330
− test_run_gc_async_with_orphan_completes method async_method test_run_gc_async_with_orphan_completes L333–339
− TestBuildSymbolIndexAsyncUnit class class TestBuildSymbolIndexAsyncUnit L169–196
− test_logs_warning_on_failure method async_method test_logs_warning_on_failure L189–196
− test_swallows_db_connection_error method async_method test_swallows_db_connection_error L172–176
− test_swallows_indexer_exception method async_method test_swallows_indexer_exception L178–187
− test_build_symbol_async_exception_not_propagated method async_method test_build_symbol_async_exception_not_propagated L556–563
− test_gc_async_exception_not_propagated_to_caller method async_method test_gc_async_exception_not_propagated_to_caller L546–554
− test_run_gc_async_mocked_under_50ms method async_method test_run_gc_async_mocked_under_50ms L640–652
− test_concurrent_gc_async_calls_idempotent method async_method test_concurrent_gc_async_calls_idempotent L420–430
− TestRunGcAsyncUnit class class TestRunGcAsyncUnit L199–226
− test_logs_warning_on_failure method async_method test_logs_warning_on_failure L219–226
− test_swallows_db_error method async_method test_swallows_db_error L202–206
− test_swallows_gc_service_error method async_method test_swallows_gc_service_error L208–217
− AsyncMock import import AsyncMock L14–14
− MagicMock import import MagicMock L14–14
− _build_symbol_index_async import import _build_symbol_index_async L20–20
− _run_gc_async import import _run_gc_async L20–20
− patch import import patch L14–14
+ test_run_gc_completes_on_real_db method async_method test_run_gc_completes_on_real_db L265–271
+ test_run_gc_with_orphan_completes method async_method test_run_gc_with_orphan_completes L273–280
+ test_gc_result_construction_fast method async_method test_gc_result_construction_fast L534–540
+ test_sequential_gc_calls_idempotent method async_method test_sequential_gc_calls_idempotent L333–343
+ msgpack import import msgpack L18–18
~ tests/test_mcp_read_tools.py .py 1 symbol added, 1 symbol removed, 77 symbols modified
− execute_get_commit import import execute_get_commit L85–85
+ execute_read_commit import import execute_read_commit L85–85
~ tests/test_mcp_smoke.py .py 54 symbols modified
~ tests/test_mcp_write_tools.py .py 3 symbols added, 3 symbols removed, 179 symbols modified
− execute_patch_repo_settings import import execute_patch_repo_settings L102–102
− execute_set_issue_labels import import execute_set_issue_labels L76–76
− execute_submit_proposal_review import import execute_submit_proposal_review L87–87
+ execute_create_proposal_review import import execute_create_proposal_review L87–87
+ execute_update_issue_labels import import execute_update_issue_labels L76–76
+ execute_update_repo import import execute_update_repo L102–102
~ tests/test_merge_proposals.py .py 43 symbols modified
~ tests/test_migrations_section36.py .py 10 symbols added, 3 symbols removed, 13 symbols modified
− test_all_25_migrations_present method method test_all_25_migrations_present L230–235
− test_head_revision_is_0028 method method test_head_revision_is_0028 L237–259
− _PG_BASE_URL variable variable _PG_BASE_URL L41–41
+ test_all_40_migrations_present method method test_all_40_migrations_present L267–270
+ test_head_revision_is_0040 method method test_head_revision_is_0040 L272–292
+ _PERF_TEST_DB variable variable _PERF_TEST_DB L60–60
+ _PERF_TEST_URL variable variable _PERF_TEST_URL L61–61
+ _PROJECT_ROOT variable variable _PROJECT_ROOT L43–43
+ _perf_fresh_db function function _perf_fresh_db L200–212
+ _raw_db_url variable variable _raw_db_url L49–49
+ _urlparse import import _urlparse L34–34
+ os import import os L28–28
+ pathlib import import pathlib L29–29
~ _HEAD
~ tests/test_musehub_coord.py .py 52 symbols modified
~ tests/test_musehub_proposals.py .py 43 symbols modified
~ tests/test_musehub_repos.py .py 77 symbols modified
− pytestmark variable variable pytestmark L29–29
~ tests/test_musehub_ui_team.py .py 1 symbol removed
− pytestmark variable variable pytestmark L41–41
~ tests/test_releases.py .py 67 symbols modified
~ tests/test_secrets_management_section72.py .py 2 symbols added, 3 symbols modified
+ _skip_no_compose variable variable _skip_no_compose L34–37
+ _skip_no_dockerfile variable variable _skip_no_dockerfile L30–33
~ tests/test_sessions_section30.py .py 51 symbols modified
~ tests/test_storage_backends_section33.py .py 45 symbols modified

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:8d27b86a45e0ccaa37f75b8cffe41b0413fbd38a2bb06e02169e2a45d54cb547 --body "your comment"