@@ -430,6 +430,7 @@ def test_registry_to_pooch_format(self, synced_registry):
430430 assert len (pooch_registry ) == len (synced_registry .files )
431431
432432
433+ @pytest .mark .xdist_group ("registry_cache" )
433434class TestCLI :
434435 """Test CLI commands."""
435436
@@ -453,7 +454,7 @@ def test_cli_list_empty(self, capsys):
453454
454455 from modflow_devtools .models .__main__ import cmd_list
455456
456- args = argparse .Namespace (verbose = False )
457+ args = argparse .Namespace (verbose = False , source = None , ref = None )
457458 cmd_list (args )
458459
459460 captured = capsys .readouterr ()
@@ -526,6 +527,10 @@ def test_cli_copy(self, tmp_path):
526527 result = source .sync (ref = TEST_MODELS_REF )
527528 assert len (result .synced ) == 1
528529
530+ # Invalidate cached default registry so it reloads with newly synced data
531+ import modflow_devtools .models
532+ modflow_devtools .models ._default_registry_cache = None
533+
529534 # Load registry and get first model name
530535 registry = _DEFAULT_CACHE .load (TEST_MODELS_SOURCE_NAME , TEST_MODELS_REF )
531536 assert len (registry .models ) > 0
@@ -558,6 +563,10 @@ def test_cli_copy_nonexistent_model(self, tmp_path, capsys):
558563 result = source .sync (ref = TEST_MODELS_REF )
559564 assert len (result .synced ) == 1
560565
566+ # Invalidate cached default registry so it reloads with newly synced data
567+ import modflow_devtools .models
568+ modflow_devtools .models ._default_registry_cache = None
569+
561570 # Try to copy nonexistent model
562571 import argparse
563572
@@ -586,6 +595,11 @@ def test_cli_cp_alias(self, tmp_path):
586595 result = source .sync (ref = TEST_MODELS_REF )
587596 assert len (result .synced ) == 1
588597
598+ # Invalidate cached default registry so it reloads with newly synced data
599+ import modflow_devtools .models
600+
601+ modflow_devtools .models ._default_registry_cache = None
602+
589603 # Load registry and get first model name
590604 registry = _DEFAULT_CACHE .load (TEST_MODELS_SOURCE_NAME , TEST_MODELS_REF )
591605 assert len (registry .models ) > 0
@@ -619,6 +633,11 @@ def test_python_cp_alias(self, tmp_path):
619633 result = source .sync (ref = TEST_MODELS_REF )
620634 assert len (result .synced ) == 1
621635
636+ # Invalidate cached default registry so it reloads with newly synced data
637+ import modflow_devtools .models
638+
639+ modflow_devtools .models ._default_registry_cache = None
640+
622641 # Load registry and get first model name
623642 registry = _DEFAULT_CACHE .load (TEST_MODELS_SOURCE_NAME , TEST_MODELS_REF )
624643 assert len (registry .models ) > 0
0 commit comments