From 9daa3190346d51ff3d80bbb8f74040073ad32f51 Mon Sep 17 00:00:00 2001 From: Jan Stodola Date: Wed, 23 Sep 2026 13:37:23 +0200 Subject: [PATCH 1/2] Replace deprecated assertEquals with assertEqual in tests assertEquals is a deprecated alias removed from newer Python versions, causing pylint E1101 no-member errors. Co-Authored-By: Claude Sonnet 5 --- .../anaconda_webui/test_installationsource.py | 22 +++++++++---------- .../everything_event/test_everything.py | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libpermian/plugins/anaconda_webui/test_installationsource.py b/libpermian/plugins/anaconda_webui/test_installationsource.py index 5ec9d69..e54b85d 100644 --- a/libpermian/plugins/anaconda_webui/test_installationsource.py +++ b/libpermian/plugins/anaconda_webui/test_installationsource.py @@ -36,22 +36,22 @@ def test_conversion_rhel(self): mock_compose = MockComposeStructure('RHEL', ('AppStream', 'BaseOS', 'CRB')) installation_source = InstallationSourceStructure.from_compose(mock_compose) - self.assertEquals(installation_source.kernel_path('x86_64'), 'http://example.com/BaseOS/x86_64/linux') - self.assertEquals(installation_source.initrd_path('x86_64'), 'http://example.com/BaseOS/x86_64/initrd') - self.assertEquals(installation_source.kernel_path('aarch64'), 'http://example.com/BaseOS/aarch64/linux') - self.assertEquals(installation_source.initrd_path('aarch64'), 'http://example.com/BaseOS/aarch64/initrd') + self.assertEqual(installation_source.kernel_path('x86_64'), 'http://example.com/BaseOS/x86_64/linux') + self.assertEqual(installation_source.initrd_path('x86_64'), 'http://example.com/BaseOS/x86_64/initrd') + self.assertEqual(installation_source.kernel_path('aarch64'), 'http://example.com/BaseOS/aarch64/linux') + self.assertEqual(installation_source.initrd_path('aarch64'), 'http://example.com/BaseOS/aarch64/initrd') - self.assertEquals(installation_source.base_repo['x86_64']['os'], 'http://example.com/BaseOS/x86_64/os') + self.assertEqual(installation_source.base_repo['x86_64']['os'], 'http://example.com/BaseOS/x86_64/os') - self.assertEquals(installation_source.repos['AppStream']['x86_64'], {"os": "http://example.com/AppStream/x86_64/os"}) + self.assertEqual(installation_source.repos['AppStream']['x86_64'], {"os": "http://example.com/AppStream/x86_64/os"}) def test_conversion_fedora(self): mock_compose = MockComposeStructure('Fedora', ('Everything',)) installation_source = InstallationSourceStructure.from_compose(mock_compose) - self.assertEquals(installation_source.kernel_path('x86_64'), 'http://example.com/Everything/x86_64/linux') - self.assertEquals(installation_source.initrd_path('x86_64'), 'http://example.com/Everything/x86_64/initrd') - self.assertEquals(installation_source.kernel_path('aarch64'), 'http://example.com/Everything/aarch64/linux') - self.assertEquals(installation_source.initrd_path('aarch64'), 'http://example.com/Everything/aarch64/initrd') + self.assertEqual(installation_source.kernel_path('x86_64'), 'http://example.com/Everything/x86_64/linux') + self.assertEqual(installation_source.initrd_path('x86_64'), 'http://example.com/Everything/x86_64/initrd') + self.assertEqual(installation_source.kernel_path('aarch64'), 'http://example.com/Everything/aarch64/linux') + self.assertEqual(installation_source.initrd_path('aarch64'), 'http://example.com/Everything/aarch64/initrd') - self.assertEquals(installation_source.base_repo['x86_64']['os'], 'http://example.com/Everything/x86_64/os') + self.assertEqual(installation_source.base_repo['x86_64']['os'], 'http://example.com/Everything/x86_64/os') diff --git a/libpermian/plugins/everything_event/test_everything.py b/libpermian/plugins/everything_event/test_everything.py index b389511..b3e0a54 100644 --- a/libpermian/plugins/everything_event/test_everything.py +++ b/libpermian/plugins/everything_event/test_everything.py @@ -23,7 +23,7 @@ def test_additional_testplan(self): }''' event = EventFactory.make(self.settings, event_string) - self.assertEquals(event.additional_testplans_data, + self.assertEqual(event.additional_testplans_data, [{'name': 'Everything', 'point_person': 'tester@example.com', 'artifact_type': 'everything', @@ -42,7 +42,7 @@ def test_additional_testplan_reporting(self): } }''' event = EventFactory.make(self.settings, event_string) - self.assertEquals(event.additional_testplans_data, + self.assertEqual(event.additional_testplans_data, [{'name': 'Everything', 'point_person': 'tester@example.com', 'artifact_type': 'everything', From aee5fee0f6a80f0c2d47c6acae34ae7970ae5a56 Mon Sep 17 00:00:00 2001 From: Jan Stodola Date: Wed, 23 Sep 2026 13:37:28 +0200 Subject: [PATCH 2/2] Initialize workflow variables before conditional loops in test_testruns Fixes pylint E0606 possibly-used-before-assignment: the variables were only assigned inside an if-branch of a for loop, so pylint couldn't guarantee they were bound before use. Co-Authored-By: Claude Sonnet 5 --- libpermian/testruns/test_testruns.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libpermian/testruns/test_testruns.py b/libpermian/testruns/test_testruns.py index 3567fdf..398e51e 100644 --- a/libpermian/testruns/test_testruns.py +++ b/libpermian/testruns/test_testruns.py @@ -72,6 +72,8 @@ def tearDownClass(cls): WorkflowFactory.restore_workflow_classes() def test_isolated(self): + workflow1 = None + workflow2 = None for caserun in self.testruns.caseRunConfigurations: if caserun.testcase.name == 'test_isolated 1': workflow1 = caserun.workflow @@ -83,6 +85,9 @@ def test_isolated(self): self.assertNotEqual(workflow1, workflow2) def test_grouped_all(self): + workflow1 = None + workflow2 = None + workflow3 = None for caserun in self.testruns.caseRunConfigurations: if caserun.testcase.name == 'test_grouped 1': workflow1 = caserun.workflow @@ -98,6 +103,7 @@ def test_grouped_all(self): self.assertEqual(workflow2, workflow3) def test_manual(self): + workflow = None for caserun in self.testruns.caseRunConfigurations: if caserun.testcase.name == 'testcase 1': workflow = caserun.workflow @@ -105,6 +111,7 @@ def test_manual(self): self.assertIsInstance(workflow, ManualWorkflow) def test_unknown(self): + workflow = None for caserun in self.testruns.caseRunConfigurations: if caserun.testcase.name == 'testcase 2': workflow = caserun.workflow @@ -124,6 +131,9 @@ def tearDownClass(cls): WorkflowFactory.restore_workflow_classes() def test_grouped_by_config(self): + workflow1 = None + workflow2 = None + workflow3 = None for caserun in self.testruns.caseRunConfigurations: if caserun.testcase.name == 'test_grouped 1': workflow1 = caserun.workflow