tests: bookmark config import tests set up the app's shared context

They read `successful_import`, which lives in the shared context that
`async_client` attaches.  They only passed when an earlier test in the
same xdist worker had attached it; run first, all 13 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-10-06 17:31:36 -06:00
parent 8b846c57eb
commit 1c214f4033
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -175,7 +175,7 @@ def test_bookmarks_config_import(test_directory, test_wrolpi_config):
['not a node'],
'not a list',
])
def test_bookmarks_config_import_rejects_bad_tree(test_directory, test_wrolpi_config, bookmarks):
async def test_bookmarks_config_import_rejects_bad_tree(async_client, test_directory, test_wrolpi_config, bookmarks):
"""A hand-edited file that the API would refuse is not imported, and is not overwritten."""
config_file = test_directory / 'config/bookmarks.yaml'
config_file.parent.mkdir(exist_ok=True)
@ -195,7 +195,7 @@ def test_bookmarks_config_import_rejects_bad_tree(test_directory, test_wrolpi_co
assert config_file.read_text() == original
def test_bookmarks_config_import_rejects_cycle(test_directory, test_wrolpi_config):
async def test_bookmarks_config_import_rejects_cycle(async_client, test_directory, test_wrolpi_config):
"""A YAML anchor can make a directory contain itself; walking that would never end."""
config_file = test_directory / 'config/bookmarks.yaml'
config_file.parent.mkdir(exist_ok=True)