leapp-repository/SOURCES/0007-networkmanagerconnectionscanner-Skip-test-on-Python-.patch
2025-12-01 09:14:24 +00:00

47 lines
1.9 KiB
Diff

From db8d1f3fcc155b94b07d89d90eb82cd2a52d5cf9 Mon Sep 17 00:00:00 2001
From: Matej Matuska <mmatuska@redhat.com>
Date: Wed, 20 Aug 2025 15:41:34 +0200
Subject: [PATCH 07/55] networkmanagerconnectionscanner: Skip test on Python !=
3.6
The test_nm_conn tests fails on at least Python >= 3.9 (not sure which
version exactly).
Let's skip the test on Python != 3.6 as they never run on a different
version - the actor is in the el8toel9 repo and is in FactsPhase.
---
.../unit_test_networkmanagerconnectionscanner.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py b/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
index 46af07c1..7558b307 100644
--- a/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
+++ b/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
@@ -1,4 +1,5 @@
import errno
+import sys
import textwrap
import pytest
@@ -57,7 +58,16 @@ def test_no_conf(monkeypatch):
assert not api.produce.called
-@pytest.mark.skipif(not nmconnscanner.libnm_available, reason="NetworkManager g-ir not installed")
+@pytest.mark.skipif(
+ sys.version_info.major != 3 or sys.version_info.minor != 6,
+ # On Python > 3.6 the GLib and NM libraries apparently behave differently and
+ # the test fails. Let's skip it since the actor it's only ever run with
+ # Python3.6 (el8toel9 repo and FactsPhase)
+ reason="Only runs on Python 3.6",
+)
+@pytest.mark.skipif(
+ not nmconnscanner.libnm_available, reason="NetworkManager g-ir not installed"
+)
def test_nm_conn(monkeypatch):
"""
Check a basic keyfile
--
2.51.1