Skip to content

Commit 172778b

Browse files
Fix GitHub CI
1 parent ab68d38 commit 172778b

15 files changed

+64
-144
lines changed

pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ mypy = [
7171
"types-six",
7272
"types-toml",
7373
]
74-
# pyre introduced two false-postives recently, pin it to prevent further surprises:
75-
pyre = [
76-
"pyre-check == 0.9.23",
77-
"pyre-extensions == 0.0.30",
78-
]
7974
pytype = [
8075
"pandas",
8176
"pytype",
@@ -198,7 +193,7 @@ exclude = [
198193
extraPaths = ["stubs"]
199194
include = ["xcp", "tests"]
200195
pythonPlatform = "Linux"
201-
pythonVersion = "3.6"
196+
pythonVersion = "3.11"
202197
reportFunctionMemberAccess = true
203198
reportGeneralTypeIssues = "warning"
204199
reportOptionalMemberAccess = "warning"

pyre_runner.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

pytest.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ filterwarnings=ignore:Unknown config option
3737
pythonpath=stubs
3838
# Disable when using pytest >= 7.0.0:
3939
# Used by pytest-pythonpath for Python >=2.7 (https://pypi.org/project/pytest-pythonpath):
40-
python_paths=stubs
40+
# Can now only be activated when using newer pytest:
41+
#python_paths=stubs

stubs/pyfakefs/__init__.pyi

Whitespace-only changes.

stubs/pyfakefs/fake_filesystem_unittest.pyi

Lines changed: 0 additions & 20 deletions
This file was deleted.

stubs/pytest.pyi

Lines changed: 0 additions & 8 deletions
This file was deleted.

stubs/werkzeug/wrappers.pyi

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/httpserver_testcase.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import unittest
34
from typing import Callable, Optional
45

@@ -11,9 +12,10 @@
1112
from pytest_httpserver import HTTPServer
1213
from werkzeug.wrappers import Request, Response
1314

14-
ErrorHandler = Optional[Callable[[Request], Response]]
15+
ErrorHandler = Optional[Callable[[Request], Response | None]]
1516
except ImportError:
1617
pytest.skip(allow_module_level=True)
18+
sys.exit(0) # Let pyright know that this is a dead end
1719

1820

1921
class HTTPServerTestCase(unittest.TestCase):
@@ -31,7 +33,7 @@ def tearDownClass(cls):
3133

3234
@classmethod
3335
def serve_file(cls, root, file_path, error_handler=None, real_path=None):
34-
# type:(str, str, Optional[Callable[[Request], Response]], Optional[str]) -> None
36+
# type:(str, str, ErrorHandler, Optional[str]) -> None
3537
"""Expect a GET request and handle it using the local pytest_httpserver.HTTPServer"""
3638

3739
def handle_get(request):

tests/test_accessor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import unittest
22

33
from pyfakefs.fake_filesystem import FakeFilesystem
4+
from pytest import LogCaptureFixture
45

56
import xcp.accessor
67

78
from .test_mountingaccessor import check_binary_read, check_binary_write
89

910

10-
def test_file_accessor(fs):
11-
# type:(FakeFilesystem) -> None
11+
def test_file_accessor(fs, caplog):
12+
# type(FakeFilesystem, LogCaptureFixture) -> None
1213
"""Test FileAccessor.writeFile(), .openAddress and .access using pyfakefs"""
1314
accessor = xcp.accessor.createAccessor("file://repo/", False)
1415
assert isinstance(accessor, xcp.accessor.FileAccessor)
1516
check_binary_read(accessor, "/repo", fs)
16-
check_binary_write(accessor, "/repo", fs)
17+
check_binary_write(accessor, "/repo", fs, caplog)
1718

1819

1920
class TestAccessor(unittest.TestCase):

tests/test_ftpaccessor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
from io import BytesIO
2222

2323
import pytest
24-
import pytest_localftpserver # pylint: disable=unused-import # Ensure that it is installed
24+
import pytest_localftpserver # Ensure that it is installed
2525
from six import ensure_binary, ensure_str
2626

2727
import xcp.accessor
2828

2929
binary_data = b"\x80\x91\xaa\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xcc\xdd\xee\xff"
3030
text_data = "✋➔Hello Accessor from the 🗺, download and verify ✅ me!"
31+
assert pytest_localftpserver
3132

3233

3334
def upload_textfile(ftpserver, accessor):

0 commit comments

Comments
 (0)