Skip to content

Commit

Permalink
Fix GitHub CI: pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardkaindl committed Nov 14, 2024
1 parent 16167c0 commit 88ab064
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test_mountingaccessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"]
Expand Down
4 changes: 3 additions & 1 deletion tests/test_pci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down Expand Up @@ -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()
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 88ab064

Please sign in to comment.