Skip to content

Commit

Permalink
Add test to see if conda#155 is resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusvniekerk committed Mar 2, 2022
1 parent 8152277 commit 7337ebd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 0 additions & 2 deletions conda_lock/src_parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
import pathlib

from collections import defaultdict, namedtuple
from dataclasses import dataclass
from itertools import chain
from typing import ClassVar, Dict, List, Literal, Optional, Sequence, Set, Tuple, Union

from pydantic import BaseModel, Field, validator

from conda_lock.common import ordered_union
from conda_lock.lookup import conda_name_to_pypi_name, pypi_name_to_conda_name
from conda_lock.models.channel import Channel
from conda_lock.virtual_package import FakeRepoData

Expand Down
20 changes: 20 additions & 0 deletions tests/test_conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ def pip_environment_different_names_same_deps():
# child.unlink()


@pytest.fixture
def pip_environment_regression_gh155():
root = TEST_DIR.joinpath("test-pypi-resolve-gh155")
envfile = root.joinpath("environment.yml")
yield envfile
# for child in root.iterdir():
# if child != envfile:
# child.unlink()


@pytest.fixture
def pip_local_package_environment():
return TEST_DIR.joinpath("test-local-pip").joinpath("environment.yml")
Expand Down Expand Up @@ -421,6 +431,16 @@ def test_run_lock_with_pip_environment_different_names_same_deps(
run_lock([pip_environment_different_names_same_deps], conda_exe=conda_exe)


def test_run_lock_regression_gh155(
monkeypatch, pip_environment_regression_gh155, conda_exe
):
with filelock.FileLock(str(pip_environment_regression_gh155.parent / "filelock")):
monkeypatch.chdir(pip_environment_regression_gh155.parent)
if is_micromamba(conda_exe):
monkeypatch.setenv("CONDA_FLAGS", "-v")
run_lock([pip_environment_regression_gh155], conda_exe=conda_exe)


def test_run_lock_with_local_package(
monkeypatch, pip_local_package_environment, conda_exe
):
Expand Down

0 comments on commit 7337ebd

Please sign in to comment.