You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we rebuild pre-commit in Fedora 37 with Python 3.11, 63 tests error with:
________ ERROR at teardown of test_install_uninstall_default_hook_types ________
recwarn = WarningsRecorder(record=True)
@pytest.fixture(autouse=True)
def no_warnings(recwarn):
yield
warnings = []
for warning in recwarn: # pragma: no cover
message = str(warning.message)
# ImportWarning: Not importing directory '...' missing __init__(.py)
if not (
isinstance(warning.message, ImportWarning) and
message.startswith('Not importing directory ') and
' missing __init__' in message
):
warnings.append(
f'{warning.filename}:{warning.lineno} {message}',
)
> assert not warnings
E AssertionError: assert not ['/builddir/build/BUILD/pre-commit-2.19.0/pre_commit/util.py:72 read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.', '/usr/lib64/python3.11/importlib/resources/_legacy.py:80 open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.']
tests/conftest.py:39: AssertionError
Another 4 error with:
__________ ERROR at teardown of test_archive_root_stat[rbenv.tar.gz] ___________
recwarn = WarningsRecorder(record=True)
@pytest.fixture(autouse=True)
def no_warnings(recwarn):
yield
warnings = []
for warning in recwarn: # pragma: no cover
message = str(warning.message)
# ImportWarning: Not importing directory '...' missing __init__(.py)
if not (
isinstance(warning.message, ImportWarning) and
message.startswith('Not importing directory ') and
' missing __init__' in message
):
warnings.append(
f'{warning.filename}:{warning.lineno} {message}',
)
> assert not warnings
E AssertionError: assert not ['/builddir/build/BUILD/pre-commit-2.19.0/pre_commit/util.py:68 open_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.']
tests/conftest.py:39: AssertionError
pre-commit --version
2.19.0
.pre-commit-config.yaml
not relevant, this is the test suite
~/.cache/pre-commit/pre-commit.log (if present)
No response
The text was updated successfully, but these errors were encountered:
I've tried to play with PYTHONWARNINGS and no luck. The only way I could get this to pass was to adapt the no_warnings fixture. Would that be accepted here, o should we carry it downstream only?
diff --git a/tests/conftest.py b/tests/conftest.py
index b68a1d0..b04680b 100644
--- a/tests/conftest.py+++ b/tests/conftest.py@@ -28,11 +28,14 @@ def no_warnings(recwarn):
for warning in recwarn: # pragma: no cover
message = str(warning.message)
# ImportWarning: Not importing directory '...' missing __init__(.py)
- if not (+ if not ((
isinstance(warning.message, ImportWarning) and
message.startswith('Not importing directory ') and
' missing __init__' in message
- ):+ ) or (+ isinstance(warning.message, DeprecationWarning) and+ '#migrating-from-legacy' in message+ )):
warnings.append(
f'{warning.filename}:{warning.lineno} {message}',
)
search tried in the issue tracker
read_text
describe your issue
When we rebuild pre-commit in Fedora 37 with Python 3.11, 63 tests error with:
Another 4 error with:
pre-commit --version
2.19.0
.pre-commit-config.yaml
not relevant, this is the test suite
~/.cache/pre-commit/pre-commit.log (if present)
No response
The text was updated successfully, but these errors were encountered: