From 2af6e3cc71dd24d02813595d89366b52b44e6aac Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 22:19:25 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit for more information, see https://pre-commit.ci Signed-off-by: Bernát Gábor --- src/virtualenv/activation/via_template.py | 2 +- src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py | 3 +-- tests/unit/discovery/py_info/test_py_info.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/virtualenv/activation/via_template.py b/src/virtualenv/activation/via_template.py index 994876c32..239318cde 100644 --- a/src/virtualenv/activation/via_template.py +++ b/src/virtualenv/activation/via_template.py @@ -27,7 +27,7 @@ def generate(self, creator): generated = self._generate(replacements, self.templates(), dest_folder, creator) if self.flag_prompt is not None: creator.pyenv_cfg["prompt"] = self.flag_prompt - return generated # noqa: RET504 + return generated def replacements(self, creator, dest_folder): # noqa: ARG002 return { diff --git a/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py b/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py index 598abfaa8..42c191fcb 100644 --- a/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py +++ b/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py @@ -74,7 +74,7 @@ def sources(cls, interpreter): @property def reload_code(self): result = super().reload_code - result = dedent( + return dedent( f""" # the bundled site.py always adds the global site package if we're on python framework build, escape this import sys @@ -86,7 +86,6 @@ def reload_code(self): sys._framework = before """, ) - return result def fix_mach_o(exe, current, new, max_size): diff --git a/tests/unit/discovery/py_info/test_py_info.py b/tests/unit/discovery/py_info/test_py_info.py index d1f707ed0..89c98dfc4 100644 --- a/tests/unit/discovery/py_info/test_py_info.py +++ b/tests/unit/discovery/py_info/test_py_info.py @@ -122,7 +122,6 @@ def test_py_info_cached_error(mocker, tmp_path, session_app_data): @pytest.mark.skipif(not fs_supports_symlink(), reason="symlink is not supported") -@pytest.mark.xfail(IS_PYPY and IS_WIN and sys.version_info[0:2] == (3, 9), reason="symlink is not supported") def test_py_info_cached_symlink_error(mocker, tmp_path, session_app_data): spy = mocker.spy(cached_py_info, "_run_subprocess") with pytest.raises(RuntimeError): @@ -145,6 +144,7 @@ def test_py_info_cache_clear(mocker, session_app_data): assert spy.call_count >= 2 * count +@pytest.mark.xfail(IS_PYPY and IS_WIN and sys.version_info[0:2] == (3, 9), reason="symlink is not supported") @pytest.mark.skipif(not fs_supports_symlink(), reason="symlink is not supported") def test_py_info_cached_symlink(mocker, tmp_path, session_app_data): spy = mocker.spy(cached_py_info, "_run_subprocess")