Skip to content

Commit

Permalink
cleanup: fix pytest warnings (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv authored Apr 25, 2023
1 parent 2ec9274 commit 0739da2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion micromamba/tests/test_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def teardown_class(cls):
shutil.rmtree(TestInstall.root_prefix)

@classmethod
def teardown(cls):
def teardown_method(cls):
os.environ["MAMBA_ROOT_PREFIX"] = TestInstall.root_prefix
os.environ["CONDA_PREFIX"] = TestInstall.prefix

Expand Down
2 changes: 1 addition & 1 deletion micromamba/tests/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def teardown_class(cls):
shutil.rmtree(TestInfo.root_prefix)

@classmethod
def teardown(cls):
def teardown_method(cls):
os.environ["CONDA_PREFIX"] = TestInfo.prefix

@pytest.mark.parametrize("prefix_selection", [None, "prefix", "name"])
Expand Down
4 changes: 2 additions & 2 deletions micromamba/tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setup_class(cls):
os.environ["CONDA_PREFIX"] = TestInstall.prefix

@classmethod
def setup(cls):
def setup_method(cls):
create("-n", TestInstall.env_name, "--offline", no_dry_run=True)

@classmethod
Expand All @@ -33,7 +33,7 @@ def teardown_class(cls):
shutil.rmtree(TestInstall.root_prefix)

@classmethod
def teardown(cls):
def teardown_method(cls):
os.environ["MAMBA_ROOT_PREFIX"] = TestInstall.root_prefix
os.environ["CONDA_PREFIX"] = TestInstall.prefix
for v in ("CONDA_CHANNELS", "MAMBA_TARGET_PREFIX"):
Expand Down
2 changes: 1 addition & 1 deletion micromamba/tests/test_linking.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def teardown_class(cls):
rmtree(TestLinking.root_prefix)

@classmethod
def teardown(cls):
def teardown_method(cls):
if Path(TestLinking.prefix).exists():
rmtree(TestLinking.prefix)

Expand Down
4 changes: 2 additions & 2 deletions micromamba/tests/test_pkg_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def teardown_class(cls):
rmtree(TestPkgCache.root_prefix)

@classmethod
def teardown(cls):
def teardown_method(cls):
envs_dir = os.path.join(TestPkgCache.root_prefix, "envs")
if Path(envs_dir).exists():
rmtree(envs_dir)
Expand Down Expand Up @@ -288,7 +288,7 @@ def teardown_class(cls):
rmtree(TestMultiplePkgCaches.root_prefix)

@classmethod
def teardown(cls):
def teardown_method(cls):
if "CONDA_PKGS_DIRS" in os.environ:
os.environ.pop("CONDA_PKGS_DIRS")

Expand Down

0 comments on commit 0739da2

Please sign in to comment.