Skip to content

Commit 82734a6

Browse files
committed
Fix weird windows failure
1 parent 96c19f3 commit 82734a6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_compose.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,20 @@ def test_missing_init_py_error(hydra_restore_singletons: Any) -> None:
366366

367367

368368
def test_missing_bad_config_dir_error(hydra_restore_singletons: Any) -> None:
369+
# Use a platform-appropriate absolute path that doesn't exist
370+
if sys.platform == "win32":
371+
bad_dir = "C:\\no_way_in_hell_1234567890"
372+
else:
373+
bad_dir = "/no_way_in_hell_1234567890"
374+
369375
expected = (
370376
"Primary config directory not found."
371-
"\nCheck that the config directory '/no_way_in_hell_1234567890' exists and readable"
377+
f"\nCheck that the config directory '{bad_dir}' exists and readable"
372378
)
373379

374380
with raises(Exception, match=re.escape(expected)):
375381
with initialize_config_dir(
376-
config_dir="/no_way_in_hell_1234567890",
382+
config_dir=bad_dir,
377383
version_base=None,
378384
):
379385
hydra = GlobalHydra.instance().hydra

0 commit comments

Comments
 (0)