From ce7e5f0ebfc170f293400389923ba0ca88689e1c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 14:10:44 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/conftest.py | 2 +- tests/test_wheelinfo.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 13cfc6f..c456b12 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -197,7 +197,7 @@ def add_pkg_version( "info": { "name": name, }, - "releases": {} + "releases": {}, } releases = self.releases_map[name]["releases"] filename = self._make_wheel_filename(name, version, platform) diff --git a/tests/test_wheelinfo.py b/tests/test_wheelinfo.py index e9fc586..0688fce 100644 --- a/tests/test_wheelinfo.py +++ b/tests/test_wheelinfo.py @@ -1,8 +1,9 @@ from io import BytesIO + import pytest +from conftest import PYTEST_WHEEL, TEST_WHEEL_DIR from micropip.wheelinfo import WheelInfo -from conftest import TEST_WHEEL_DIR, PYTEST_WHEEL @pytest.fixture @@ -46,7 +47,7 @@ def test_from_package_index(): size = 1234 wheel = WheelInfo.from_package_index(name, filename, url, version, sha256, size) - + assert wheel.name == name assert str(wheel.version) == version assert wheel.url == url @@ -68,7 +69,7 @@ def test_validate(dummy_wheel): dummy_wheel.sha256 = "dummy-sha256" with pytest.raises(ValueError, match="Contents don't match hash"): dummy_wheel._validate() - + # Should succeed when checksum is the same dummy_wheel.sha256 = hashlib.sha256(b"dummy-data").hexdigest() dummy_wheel._validate() @@ -109,7 +110,7 @@ async def test_download(dummy_wheel_url): assert wheel._project_name == "pytest" assert wheel._dist is not None - + @pytest.mark.asyncio async def test_requires(dummy_wheel_url, tmp_path): @@ -122,7 +123,6 @@ async def test_requires(dummy_wheel_url, tmp_path): assert "pluggy" in requirements_default assert "hypothesis" not in requirements_default - requirements_extra_testing = [str(r.name) for r in wheel.requires({"testing"})] + requirements_extra_testing = [str(r.name) for r in wheel.requires({"testing"})] assert "pluggy" in requirements_extra_testing assert "hypothesis" in requirements_extra_testing -