Repository: facebookresearch/hydra

Issue:
Tests are leaving log files in the current directory



Discussion:

Resolving patch:
diff --git a/hydra/hydra.py b/hydra/hydra.py
--- a/hydra/hydra.py
+++ b/hydra/hydra.py
@@ -61,7 +61,7 @@ def run(self, overrides):
 
     def sweep(self, overrides):
         hydra_cfg = self.config_loader.load_hydra_cfg(overrides)
-        utils.configure_log(hydra_cfg.hydra.logging, self.verbose)
+        utils.configure_log(hydra_cfg.hydra.hydra_logging, self.verbose)
         if hydra_cfg.hydra.launcher is None:
             raise RuntimeError("Hydra launcher is not configured")
         try:
@@ -81,7 +81,7 @@ def sweep(self, overrides):
 
     def get_cfg(self, overrides):
         hydra_cfg = self._create_hydra_cfg(overrides)
-        utils.configure_log(hydra_cfg.hydra.logging, self.verbose)
+        utils.configure_log(hydra_cfg.hydra.hydra_logging, self.verbose)
         ret = utils.create_cfg(cfg_dir=self.conf_dir,
                                cfg_filename=self.conf_filename,
                                cli_overrides=overrides)
@@ -139,7 +139,7 @@ def run_hydra(task_function, config_path):
         configs = loader.load_configuration(overrides=args.overrides)
         task_cfg = configs['task_cfg']
         hydra_cfg = configs['hydra_cfg']
-        utils.configure_log(hydra_cfg.hydra.logging, args.verbose)
+        utils.configure_log(hydra_cfg.hydra.hydra_logging, args.verbose)
 
         for file, loaded in loader.get_load_history():
             if loaded:
diff --git a/hydra/utils.py b/hydra/utils.py
--- a/hydra/utils.py
+++ b/hydra/utils.py
@@ -181,7 +181,7 @@ def run_job(config_loader, hydra_cfg, task_function, overrides, verbose, job_dir
         if not os.path.exists(working_dir):
             os.makedirs(working_dir)
         os.chdir(working_dir)
-        configure_log(hydra_and_task_cfg.hydra.logging, verbose)
+        configure_log(hydra_and_task_cfg.hydra.task_logging, verbose)
         save_config(task_cfg, 'config.yaml')
         save_config(OmegaConf.from_dotlist(overrides), 'overrides.yaml')
         ret.return_value = task_function(task_cfg)
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -88,7 +88,6 @@ def coverage(session):
     """Coverage analysis."""
     session.install('coverage', 'pytest')
     session.run('python', 'setup.py', 'clean')
-    session.run('pwd')
     all_plugins = get_all_plugins()
 
     session.run('pip', 'install', '-e', '.', silent=True)
@@ -97,7 +96,7 @@ def coverage(session):
         session.run('pip', 'install', '-e', os.path.join('plugins', plugin[0]), silent=True)
 
     session.run("coverage", "erase")
-    session.run('coverage', 'run', '--append', '-m', 'pytest')
+    session.run('coverage', 'run', '--append', '-m', 'pytest', silent=True)
     for plugin in plugin_names():
         session.run('coverage', 'run', '--append', '-m', 'pytest', os.path.join('plugins', plugin), silent=True)
 


Test patch:
diff --git a/tests/test_conf_loader.py b/tests/test_conf_loader.py
--- a/tests/test_conf_loader.py
+++ b/tests/test_conf_loader.py
@@ -69,6 +69,7 @@ def test_load_history():
     config_loader = ConfigLoader(conf_dir='tests/configs', conf_filename='missing-optional-default.yaml')
     config_loader.load_configuration()
     assert config_loader.get_load_history() == [('pkg://hydra.default_conf/hydra.yaml', True),
-                                                ('pkg://hydra.default_conf/logging.yaml', True),
+                                                ('pkg://hydra.default_conf/hydra_logging.yaml', True),
+                                                ('pkg://hydra.default_conf/task_logging.yaml', True),
                                                 ('tests/configs/missing-optional-default.yaml', True),
                                                 ('tests/configs/foo/missing.yaml', False)]