Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Ignore the queuelib test file leak as a ResourceWarning too (#8018)

Adrianed98aafd0f63
diff --git a/pyproject.toml b/pyproject.toml
index ddfef02a6..f84b40768 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -324,8 +324,11 @@ filterwarnings = [
# can die within a single collection.
"ignore:.*<function connect\\.<locals>\\.remove:pytest.PytestUnraisableExceptionWarning",
# queuelib's test helpers (reused by tests/test_squeues.py) leave queue
- # files open; the resulting warning surfaces at an arbitrary GC point.
- "ignore:.*<_io\\.FileIO name=.*queuelib-tests-:pytest.PytestUnraisableExceptionWarning",
+ # files open; the resulting warning surfaces at an arbitrary GC point, as an
+ # unraisable exception or as a plain ResourceWarning, which pytest.warns()
+ # re-emits when it does not match, failing an unrelated test.
+ "ignore:.*<_io\\.\\w+ name=.*queuelib-tests-:pytest.PytestUnraisableExceptionWarning",
+ "ignore:unclosed file <_io\\.\\w+ name=.*queuelib-tests-:ResourceWarning",
# itemadapter imports pydantic.v1, which warns on Python 3.14 and higher.
"ignore:Core Pydantic V1 functionality isn't compatible:UserWarning",
# pyftpdlib imports asynchat, removed in Python 3.12, on lower versions.