diff --git a/requirements-test.txt b/requirements-test.txt --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,3 +3,4 @@ swh.core[http] >= 0.0.61 swh.scheduler[testing] >= 0.5.0 swh.storage[testing] +pytest-postgresql >= 2.1.0, < 3.0 diff --git a/swh/loader/mercurial/from_disk.py b/swh/loader/mercurial/from_disk.py --- a/swh/loader/mercurial/from_disk.py +++ b/swh/loader/mercurial/from_disk.py @@ -167,10 +167,6 @@ # If set, will override the default value self._visit_status = None - self.old_environ = os.environ.copy() - os.environ.clear() - os.environ.update(get_minimum_env()) - def pre_cleanup(self) -> None: """As a first step, will try and check for dangling data to cleanup. This should do its best to avoid raising issues. @@ -182,6 +178,10 @@ log=self.log, ) + self.old_environ = os.environ.copy() + os.environ.clear() + os.environ.update(get_minimum_env()) + def cleanup(self) -> None: """Last step executed by the loader.""" os.environ.clear() diff --git a/swh/loader/mercurial/tests/conftest.py b/swh/loader/mercurial/tests/conftest.py --- a/swh/loader/mercurial/tests/conftest.py +++ b/swh/loader/mercurial/tests/conftest.py @@ -47,3 +47,4 @@ """ os.environ["HGPLAIN"] = "" os.environ["HGRCPATH"] = "" + os.environ["HGRCSKIPREPO"] = ""