File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,8 @@ def find_configs(dirs: Optional[Iterable[str]] = None) -> List[str]:
494
494
495
495
config = os .getenv (ENV_TORCHXCONFIG )
496
496
if config is not None :
497
+ if not config :
498
+ return []
497
499
configfile = Path (config )
498
500
if not configfile .is_file ():
499
501
raise FileNotFoundError (
Original file line number Diff line number Diff line change @@ -275,6 +275,12 @@ def test_get_configs(self) -> None:
275
275
),
276
276
)
277
277
278
+ def test_no_config (self ) -> None :
279
+ config_dir = self .tmpdir
280
+ with patch .dict (os .environ , {ENV_TORCHXCONFIG : str ("" )}):
281
+ configs = find_configs (dirs = [str (config_dir )])
282
+ self .assertEqual ([], configs )
283
+
278
284
def test_find_configs (self ) -> None :
279
285
config_dir = self .tmpdir
280
286
cwd_dir = config_dir / "cwd"
You can’t perform that action at this time.
0 commit comments