From 88ab064373e994c4cf050f7844df90eb4a428009 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Fri, 15 Nov 2024 00:55:22 +0100 Subject: [PATCH] Fix GitHub CI: pylint errors --- tests/test_mountingaccessor.py | 4 ++-- tests/test_pci.py | 4 +++- tox.ini | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_mountingaccessor.py b/tests/test_mountingaccessor.py index 029c2ca5..5bc41f5c 100644 --- a/tests/test_mountingaccessor.py +++ b/tests/test_mountingaccessor.py @@ -23,6 +23,7 @@ from typing_extensions import Literal else: pytest.skip(allow_module_level=True) + sys.exit(0) # Let pyright know that this is a dead end binary_data = b"\x00\x1b\x5b\x95\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xcc\xdd\xee\xff" @@ -33,8 +34,7 @@ def expect(fp, mount): def test_device_accessor(fs, fp, mount_dir, caplog): # type: (FakeFilesystem, FakeProcess, bytes, LogCap) -> None - if sys.version_info >= (3, 0): - assert isinstance(fp, FakeProcess) + assert isinstance(fp, FakeProcess) # Test xcp.mount.bindMount() mount = [b"/bin/mount", b"--bind", b"src", b"mountpoint_dest"] diff --git a/tests/test_pci.py b/tests/test_pci.py index 13119380..13bfc6fd 100644 --- a/tests/test_pci.py +++ b/tests/test_pci.py @@ -11,6 +11,8 @@ if sys.version_info >= (3, 6): from pytest_subprocess.fake_process import FakeProcess +else: + pytest.skip(allow_module_level=True) class TestInvalid(unittest.TestCase): @@ -164,7 +166,7 @@ def test_videoclass_by_mock_calls(fp): def mock_lspci_using_open_testfile(fp): """Mock xcp.pci.PCIDevices.Popen() using open(tests/data/lspci-mn)""" with open("tests/data/lspci-mn", "rb") as fake_data: - if sys.version_info >= (3, 0): + if sys.version_info >= (3, 6): assert isinstance(fp, FakeProcess) fp.register_subprocess(["lspci", "-mn"], stdout=fake_data.read()) return PCIDevices() diff --git a/tox.ini b/tox.ini index eb0e7e29..fbbefac5 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ # 2. python 3.6 test and pylint warnings from changed lines # 3. pytype (needs Python 3.8 or newer for best results) # 4. pyright checks, pytest test report as markdown for GitHub Actions summary -envlist = py311-covcp-check-mdreport, py312-lint-pyright-pytype, py313-cov +envlist = py311-covcp-check-mdreport, py312-cov-pytype, py313-cov-lint-pyright isolated_build = true skip_missing_interpreters = true requires =