Skip to content

Commit

Permalink
[pre-commit.ci] Apply automatic pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 28, 2025
1 parent f6f5ab3 commit 4781eb8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def lock_environment(
) -> str:
context.log.info("lock_environment entrypoint for conda-lock")
conda_command = self._conda_command(
context.conda_store, namespace=context.namespace, environment=context.environment
context.conda_store,
namespace=context.namespace,
environment=context.environment,
)
conda_flags = self._conda_flags(context.conda_store)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_solve_lockfile(
request,
):
"""Test that the call to conda_lock.run_lock is formed correctly."""

mock_run_lock.side_effect = run_lock_side_effect

platforms = [conda_utils.conda_platform()]
Expand Down Expand Up @@ -81,15 +80,15 @@ def test_solve_lockfile_simple(conda_store, simple_specification):
@mock.patch("conda_store_server._internal.plugins.lock.conda_lock.conda_lock.run_lock")
def test_solve_right_conda_command(mock_run_lock, conda_store, simple_specification):
# Update conda_command settings
conda_store.set_settings(
data={"conda_command": "conda"}
)

conda_store.set_settings(data={"conda_command": "conda"})

mock_run_lock.side_effect = run_lock_side_effect

locker = conda_lock.CondaLock()
locker.lock_environment(
context=plugin_context.PluginContext(conda_store, namespace="test", environment="one"),
context=plugin_context.PluginContext(
conda_store, namespace="test", environment="one"
),
spec=simple_specification,
platforms=[conda_utils.conda_platform()],
)
Expand Down
12 changes: 9 additions & 3 deletions conda-store-server/tests/plugins/test_plugin_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
def test_run_command_no_logs():
out = io.StringIO()
err = io.StringIO()
context = PluginContext(conda_store=None, stdout=out, stderr=err, log_level=logging.ERROR)
context = PluginContext(
conda_store=None, stdout=out, stderr=err, log_level=logging.ERROR
)

context.run_command(["echo", "testing"])
assert err.getvalue() == ""
Expand All @@ -26,7 +28,9 @@ def test_run_command_no_logs():
def test_run_command_log_info():
out = io.StringIO()
err = io.StringIO()
context = PluginContext(conda_store=None, stdout=out, stderr=err, log_level=logging.INFO)
context = PluginContext(
conda_store=None, stdout=out, stderr=err, log_level=logging.INFO
)

context.run_command(["echo", "testing"])
assert err.getvalue() == ""
Expand All @@ -52,7 +56,9 @@ def test_run_command_kwargs():
"""Ensure that kwargs get passed to subprocess"""
out = io.StringIO()
err = io.StringIO()
context = PluginContext(conda_store=None, stdout=out, stderr=err, log_level=logging.ERROR)
context = PluginContext(
conda_store=None, stdout=out, stderr=err, log_level=logging.ERROR
)

# set the cwd to this directory and check that this file exists
dir_path = os.path.dirname(os.path.realpath(__file__))
Expand Down

0 comments on commit 4781eb8

Please sign in to comment.