From aba5a7a093a88f69b9cec1fef211a19bad59c246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Tue, 3 Oct 2023 13:28:20 +0000 Subject: [PATCH] Fix minor Ruff/flake8 warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` pungi/checks.py:575:17: F601 [*] Dictionary key literal `"type"` repeated pungi/phases/pkgset/pkgsets.py:617:12: E721 Do not compare types, use `isinstance()` tests/test_pkgset_source_koji.py:241:16: E721 Do not compare types, use `isinstance()` tests/test_pkgset_source_koji.py:244:16: E721 Do not compare types, use `isinstance()` tests/test_pkgset_source_koji.py:370:16: E721 Do not compare types, use `isinstance()` tests/test_pkgset_source_koji.py:374:20: E721 Do not compare types, use `isinstance()` ``` Signed-off-by: Timothée Ravier (cherry picked from commit 2534ddee99a29aeb052812d0d4daa0db30199c0e) --- pungi/checks.py | 1 - pungi/phases/pkgset/pkgsets.py | 2 +- tests/test_pkgset_source_koji.py | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pungi/checks.py b/pungi/checks.py index 385d97ef..b82b0e71 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -572,7 +572,6 @@ def make_schema(): }, "required": ["kickstart"], "additionalProperties": False, - "type": "object", }, "osbs_config": { "type": "object", diff --git a/pungi/phases/pkgset/pkgsets.py b/pungi/phases/pkgset/pkgsets.py index d0ffe1e2..5a86a993 100644 --- a/pungi/phases/pkgset/pkgsets.py +++ b/pungi/phases/pkgset/pkgsets.py @@ -625,7 +625,7 @@ class KojiPackageSet(PackageSetBase): result_srpms = [] include_packages = set(include_packages or []) - if type(event) is dict: + if isinstance(event, dict): event = event["id"] msg = "Getting latest RPMs (tag: %s, event: %s, inherit: %s)" % ( diff --git a/tests/test_pkgset_source_koji.py b/tests/test_pkgset_source_koji.py index c3d8058a..68ef7e5e 100644 --- a/tests/test_pkgset_source_koji.py +++ b/tests/test_pkgset_source_koji.py @@ -244,10 +244,10 @@ class TestGetPackageSetFromKoji(helpers.PungiTestCase): self.compose, self.koji_wrapper, event, module_info_str ) - assert type(result) is list + assert isinstance(result, list) assert len(result) == 1 module = result[0] - assert type(module) is dict + assert isinstance(module, dict) self.assertIn("module_stream", module) self.assertIn("module_version", module) self.assertIn("module_context", module) @@ -373,11 +373,11 @@ class TestGetPackageSetFromKoji(helpers.PungiTestCase): self.compose, self.koji_wrapper, event, module_info_str ) - assert type(result) is list + assert isinstance(result, list) assert len(result) == 2 module = result[0] for module in result: - assert type(module) is dict + assert isinstance(module, dict) self.assertIn("module_stream", module) self.assertIn("module_version", module) self.assertIn("module_context", module)