Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions torchx/runner/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ def find_configs(dirs: Optional[Iterable[str]] = None) -> List[str]:

config = os.getenv(ENV_TORCHXCONFIG)
if config is not None:
if not config:
return []
configfile = Path(config)
if not configfile.is_file():
raise FileNotFoundError(
Expand Down
6 changes: 6 additions & 0 deletions torchx/runner/test/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ def test_get_configs(self) -> None:
),
)

def test_no_config(self) -> None:
config_dir = self.tmpdir
with patch.dict(os.environ, {ENV_TORCHXCONFIG: str("")}):
configs = find_configs(dirs=[str(config_dir)])
self.assertEqual([], configs)

def test_find_configs(self) -> None:
config_dir = self.tmpdir
cwd_dir = config_dir / "cwd"
Expand Down
Loading