From 2601fd14cbe619df2aab87c9441f2044cebca42a Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Fri, 15 Nov 2024 12:00:00 +0100 Subject: [PATCH] pyre: Finally, remove obosolete pyre error suppressions Signed-off-by: Bernhard Kaindl --- tests/conftest.py | 4 ++-- tests/test_cpiofile.py | 1 - tests/test_httpaccessor.py | 1 - xcp/accessor.py | 1 - xcp/bootloader.py | 1 - xcp/cpiofile.py | 2 -- 6 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1a2a4974..da395853 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,10 +5,10 @@ This module is run automatically by pytest to define and enable fixtures. """ -# pyre-ignore-all-errors[21] import warnings -import pytest # pyre does not find the module when run by tox -e py311-pyre +import pytest + @pytest.fixture(autouse=True) def set_warnings(): diff --git a/tests/test_cpiofile.py b/tests/test_cpiofile.py index cd36a2f2..0371d2df 100644 --- a/tests/test_cpiofile.py +++ b/tests/test_cpiofile.py @@ -1,5 +1,4 @@ # suppress false positive on pytest missing pytest.raises(): -# pyre-ignore-all-errors[16] """ Test various modes of creating and extracting CpioFile using different compression types, opening the archive as stream and as file, using pyfakefs as filesystem without diff --git a/tests/test_httpaccessor.py b/tests/test_httpaccessor.py index d0248f7f..c6bd38fa 100644 --- a/tests/test_httpaccessor.py +++ b/tests/test_httpaccessor.py @@ -43,7 +43,6 @@ def http_get_request_data(self, url, read_file, error_handler): def assert_http_get_request_data(self, url, read_file, error_handler): # type:(str, str, ErrorHandler) -> HTTPAccessor - # pyre-ignore[23]: silence false positive with self.http_get_request_data(url, read_file, error_handler) as (httpaccessor, ref): http_accessor_filehandle = httpaccessor.openAddress(read_file) if sys.version_info >= (3, 0): diff --git a/xcp/accessor.py b/xcp/accessor.py index 0ceec1c1..afdb643d 100644 --- a/xcp/accessor.py +++ b/xcp/accessor.py @@ -24,7 +24,6 @@ """accessor - provide common interface to access methods""" import errno -# pyre-ignore-all-errors[6,16] import ftplib import io import os diff --git a/xcp/bootloader.py b/xcp/bootloader.py index 353cc7ff..81721c82 100644 --- a/xcp/bootloader.py +++ b/xcp/bootloader.py @@ -32,7 +32,6 @@ import xcp.cmd -# pyre-ignore-all-errors[21] try: # xenserver-release.rpm puts a branding.py into our xcp installation directory: from xcp import branding # type:ignore[attr-defined] # pytype: disable=import-error except ImportError: # For CI, use stubs/branding.py (./stubs is added to pythonpath) diff --git a/xcp/cpiofile.py b/xcp/cpiofile.py index 995da94c..ff8f5c7c 100644 --- a/xcp/cpiofile.py +++ b/xcp/cpiofile.py @@ -36,8 +36,6 @@ Derived from Lars Gustäbel's tarfile.py """ from __future__ import print_function -# pyre is not as good as other static analysis tools in inferring the correct types: -# pyre-ignore-all-errors[6,16] __version__ = "0.1" __author__ = "Simon Rowe"