Skip to content

Commit

Permalink
Merge pull request #38 from capitalone/dev
Browse files Browse the repository at this point in the history
Release 2022.7.1
  • Loading branch information
Faisal authored Jul 18, 2022
2 parents b11f6c5 + fa8bd01 commit c307088
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
author = "Akshay Gupta"

# The short X.Y version
version = "2022.7.0"
version = "2022.7.1"
# The full version, including alpha/beta/rc tags
release = ""

Expand Down
2 changes: 1 addition & 1 deletion edgetest_conda/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Package initialization."""

__version__ = "2022.7.0"
__version__ = "2022.7.1"

__title__ = "edgetest-conda"
__description__ = "Conda edgetest plugin"
Expand Down
2 changes: 1 addition & 1 deletion edgetest_conda/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def run_update(basedir: Path, envname: str, upgrade: List, conf: Dict):
RuntimeError
Error raised if the packages cannot be updated.
"""
if conf["update_with_conda"] is False:
if conf.get("update_with_conda", False) is False:
return None

env_manager = "mamba" if _check_mamba() else "conda"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pluggy==1.0.0
# via edgetest
pyparsing==3.0.9
# via packaging
tabulate==0.8.9
tabulate==0.8.10
# via edgetest

# The following packages are considered to be unsafe in a requirements file:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ edgetest =
conda = edgetest_conda.plugin

[bumpver]
current_version = "2022.7.0"
current_version = "2022.7.1"
version_pattern = "YYYY.MM.INC0"
commit_message = "Bump {old_version} to {new_version}"
commit = True
Expand Down
21 changes: 17 additions & 4 deletions tests/test_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@
pytest tests -m 'not integration'
"""

CFG_UPDATE_PIP_DEFAULT = """
[edgetest.envs.myenv]
conda_install =
graphviz
python_version = 3.8
upgrade =
myupgrade
command =
pytest tests -m 'not integration'
"""


CFG_NOCONDA = """
[edgetest.envs.myenv]
Expand Down Expand Up @@ -174,9 +185,10 @@ def test_conda_create(mock_popen, mock_cpopen):
assert result.output == TABLE_OUTPUT


@pytest.mark.parametrize("CFG", [CFG_UPDATE_PIP, CFG_UPDATE_PIP_DEFAULT])
@patch("edgetest.core.Popen", autospec=True)
@patch("edgetest.utils.Popen", autospec=True)
def test_conda_create_update_pip(mock_popen, mock_cpopen):
def test_conda_create_update_pip(mock_popen, mock_cpopen, CFG):
"""Test creating a basic conda environment."""
mock_popen.return_value.communicate.return_value = (PIP_LIST, "error")
type(mock_popen.return_value).returncode = PropertyMock(return_value=0)
Expand All @@ -187,7 +199,7 @@ def test_conda_create_update_pip(mock_popen, mock_cpopen):

with runner.isolated_filesystem() as loc:
with open("config.ini", "w") as outfile:
outfile.write(CFG_UPDATE_PIP)
outfile.write(CFG)

result = runner.invoke(cli, ["--config=config.ini"])

Expand Down Expand Up @@ -313,9 +325,10 @@ def test_mamba_create(mock_popen, mock_cpopen):
assert result.output == TABLE_OUTPUT


@pytest.mark.parametrize("CFG", [CFG_UPDATE_PIP, CFG_UPDATE_PIP_DEFAULT])
@patch("edgetest.core.Popen", autospec=True)
@patch("edgetest.utils.Popen", autospec=True)
def test_mamba_create_update_pip(mock_popen, mock_cpopen):
def test_mamba_create_update_pip(mock_popen, mock_cpopen, CFG):
"""Test running ``edgetest`` with ``mamba``."""
mock_popen.return_value.communicate.return_value = (PIP_LIST_MAMBA, "error")
type(mock_popen.return_value).returncode = PropertyMock(return_value=0)
Expand All @@ -326,7 +339,7 @@ def test_mamba_create_update_pip(mock_popen, mock_cpopen):

with runner.isolated_filesystem() as loc:
with open("config.ini", "w") as outfile:
outfile.write(CFG_UPDATE_PIP)
outfile.write(CFG)

result = runner.invoke(cli, ["--config=config.ini"])

Expand Down

0 comments on commit c307088

Please sign in to comment.