diff --git a/dandi/consts.py b/dandi/consts.py index 8b8e7cd1e..0b7bc1b76 100644 --- a/dandi/consts.py +++ b/dandi/consts.py @@ -5,8 +5,6 @@ from enum import Enum import os -from typing import Optional - #: A list of metadata fields which dandi extracts from .nwb files. #: Additional fields (such as ``number_of_*``) might be added by #: `get_metadata()` diff --git a/dandi/tests/test_dandiarchive.py b/dandi/tests/test_dandiarchive.py index 7f84ec58c..a6f7bd8ba 100644 --- a/dandi/tests/test_dandiarchive.py +++ b/dandi/tests/test_dandiarchive.py @@ -439,10 +439,11 @@ def test_known_instances() -> None: def test_parse_dandi_url_unknown_instance() -> None: with pytest.raises(UnknownURLError) as excinfo: parse_dandi_url("dandi://not-an-instance/000001") - assert str(excinfo.value) == ( - "Unknown instance 'not-an-instance'. Valid instances: dandi," - " dandi-api-local-docker-tests, dandi-staging, linc, linc-staging" - ) + + valid_instances = ", ".join(sorted(known_instances.keys())) + expected_message = f"Unknown instance 'not-an-instance'. Valid instances: {valid_instances}" + + assert str(excinfo.value) == expected_message @mark.skipif_no_network