From 4781eb8934be67edbb616c46330467fb8d9acec2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 18:24:58 +0000 Subject: [PATCH] [pre-commit.ci] Apply automatic pre-commit fixes --- .../_internal/plugins/lock/conda_lock/conda_lock.py | 4 +++- .../tests/_internal/plugins/lock/test_conda_lock.py | 11 +++++------ .../tests/plugins/test_plugin_context.py | 12 +++++++++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/conda-store-server/conda_store_server/_internal/plugins/lock/conda_lock/conda_lock.py b/conda-store-server/conda_store_server/_internal/plugins/lock/conda_lock/conda_lock.py index 2bb5ae72d..a4fb35c0a 100644 --- a/conda-store-server/conda_store_server/_internal/plugins/lock/conda_lock/conda_lock.py +++ b/conda-store-server/conda_store_server/_internal/plugins/lock/conda_lock/conda_lock.py @@ -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) diff --git a/conda-store-server/tests/_internal/plugins/lock/test_conda_lock.py b/conda-store-server/tests/_internal/plugins/lock/test_conda_lock.py index e89feb48b..6e00e2d6f 100644 --- a/conda-store-server/tests/_internal/plugins/lock/test_conda_lock.py +++ b/conda-store-server/tests/_internal/plugins/lock/test_conda_lock.py @@ -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()] @@ -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()], ) diff --git a/conda-store-server/tests/plugins/test_plugin_context.py b/conda-store-server/tests/plugins/test_plugin_context.py index 053976ea6..c4eec3d27 100644 --- a/conda-store-server/tests/plugins/test_plugin_context.py +++ b/conda-store-server/tests/plugins/test_plugin_context.py @@ -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() == "" @@ -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() == "" @@ -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__))