Repository: scrapy/scrapy
Pull request #6738: Syntax Error Fixed 
Author: login: MehrazRumman
Created: 2025-03-18T19:44:57Z | Merged: 2025-03-20T12:02:10Z

Issue #6731 


Diff:
diff --git a/docs/topics/settings.rst b/docs/topics/settings.rst
index ca0af569f0b..a59a61050ac 100644
--- a/docs/topics/settings.rst
+++ b/docs/topics/settings.rst
@@ -2047,6 +2047,21 @@ also used by :class:`~scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware
 if :setting:`ROBOTSTXT_USER_AGENT` setting is ``None`` and
 there is no overriding User-Agent header specified for the request.
 
+.. setting:: WARN_ON_GENERATOR_RETURN_VALUE
+
+WARN_ON_GENERATOR_RETURN_VALUE
+------------------------------
+
+Default: ``True``
+
+When enabled, Scrapy will warn if generator-based callback methods (like
+``parse``) contain return statements with non-``None`` values. This helps detect
+potential mistakes in spider development.
+
+Disable this setting to prevent syntax errors that may occur when dynamically
+modifying generator function source code during runtime, skip AST parsing of
+callback functions, or improve performance in auto-reloading development
+environments.
 
 Settings documented elsewhere:
 ------------------------------
diff --git a/scrapy/settings/default_settings.py b/scrapy/settings/default_settings.py
index 645e50301ea..680fded7a56 100644
--- a/scrapy/settings/default_settings.py
+++ b/scrapy/settings/default_settings.py
@@ -351,3 +351,5 @@
     "scrapy.contracts.default.ReturnsContract": 2,
     "scrapy.contracts.default.ScrapesContract": 3,
 }
+
+WARN_ON_GENERATOR_RETURN_VALUE = True
diff --git a/scrapy/utils/misc.py b/scrapy/utils/misc.py
index d319e7950f1..b7b4362602c 100644
--- a/scrapy/utils/misc.py
+++ b/scrapy/utils/misc.py
@@ -286,6 +286,8 @@ def warn_on_generator_with_return_value(
     Logs a warning if a callable is a generator function and includes
     a 'return' statement with a value different than None
     """
+    if not spider.settings.getbool("WARN_ON_GENERATOR_RETURN_VALUE"):
+        return
     try:
         if is_generator_with_return_value(callable):
             warnings.warn(
diff --git a/tests/test_utils_misc/test_return_with_argument_inside_generator.py b/tests/test_utils_misc/test_return_with_argument_inside_generator.py
index 81a83c3d7ac..ad31e5185a1 100644
--- a/tests/test_utils_misc/test_return_with_argument_inside_generator.py
+++ b/tests/test_utils_misc/test_return_with_argument_inside_generator.py
@@ -2,6 +2,8 @@
 from functools import partial
 from unittest import mock
 
+import pytest
+
 from scrapy.utils.misc import (
     is_generator_with_return_value,
     warn_on_generator_with_return_value,
@@ -40,7 +42,24 @@ def generator_that_returns_stuff():
 
 
 class TestUtilsMisc:
-    def test_generators_return_something(self):
+    @pytest.fixture
+    def mock_spider(self):
+        class MockSettings:
+            def __init__(self, settings_dict=None):
+                self.settings_dict = settings_dict or {
+                    "WARN_ON_GENERATOR_RETURN_VALUE": True
+                }
+
+            def getbool(self, name, default=False):
+                return self.settings_dict.get(name, default)
+
+        class MockSpider:
+            def __init__(self):
+                self.settings = MockSettings()
+
+        return MockSpider()
+
+    def test_generators_return_something(self, mock_spider):
         def f1():
             yield 1
             return 2
@@ -75,30 +94,30 @@ def i1():
         assert is_generator_with_return_value(i1)
 
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, top_level_return_something)
+            warn_on_generator_with_return_value(mock_spider, top_level_return_something)
             assert len(w) == 1
             assert (
-                'The "NoneType.top_level_return_something" method is a generator'
+                'The "MockSpider.top_level_return_something" method is a generator'
                 in str(w[0].message)
             )
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, f1)
+            warn_on_generator_with_return_value(mock_spider, f1)
             assert len(w) == 1
-            assert 'The "NoneType.f1" method is a generator' in str(w[0].message)
+            assert 'The "MockSpider.f1" method is a generator' in str(w[0].message)
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, g1)
+            warn_on_generator_with_return_value(mock_spider, g1)
             assert len(w) == 1
-            assert 'The "NoneType.g1" method is a generator' in str(w[0].message)
+            assert 'The "MockSpider.g1" method is a generator' in str(w[0].message)
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, h1)
+            warn_on_generator_with_return_value(mock_spider, h1)
             assert len(w) == 1
-            assert 'The "NoneType.h1" method is a generator' in str(w[0].message)
+            assert 'The "MockSpider.h1" method is a generator' in str(w[0].message)
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, i1)
+            warn_on_generator_with_return_value(mock_spider, i1)
             assert len(w) == 1
-            assert 'The "NoneType.i1" method is a generator' in str(w[0].message)
+            assert 'The "MockSpider.i1" method is a generator' in str(w[0].message)
 
-    def test_generators_return_none(self):
+    def test_generators_return_none(self, mock_spider):
         def f2():
             yield 1
 
@@ -142,31 +161,31 @@ def l2():
         assert not is_generator_with_return_value(l2)
 
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, top_level_return_none)
+            warn_on_generator_with_return_value(mock_spider, top_level_return_none)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, f2)
+            warn_on_generator_with_return_value(mock_spider, f2)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, g2)
+            warn_on_generator_with_return_value(mock_spider, g2)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, h2)
+            warn_on_generator_with_return_value(mock_spider, h2)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, i2)
+            warn_on_generator_with_return_value(mock_spider, i2)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, j2)
+            warn_on_generator_with_return_value(mock_spider, j2)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, k2)
+            warn_on_generator_with_return_value(mock_spider, k2)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, l2)
+            warn_on_generator_with_return_value(mock_spider, l2)
             assert len(w) == 0
 
-    def test_generators_return_none_with_decorator(self):
+    def test_generators_return_none_with_decorator(self, mock_spider):
         def decorator(func):
             def inner_func():
                 func()
@@ -223,36 +242,36 @@ def l3():
         assert not is_generator_with_return_value(l3)
 
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, top_level_return_none)
+            warn_on_generator_with_return_value(mock_spider, top_level_return_none)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, f3)
+            warn_on_generator_with_return_value(mock_spider, f3)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, g3)
+            warn_on_generator_with_return_value(mock_spider, g3)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, h3)
+            warn_on_generator_with_return_value(mock_spider, h3)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, i3)
+            warn_on_generator_with_return_value(mock_spider, i3)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, j3)
+            warn_on_generator_with_return_value(mock_spider, j3)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, k3)
+            warn_on_generator_with_return_value(mock_spider, k3)
             assert len(w) == 0
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, l3)
+            warn_on_generator_with_return_value(mock_spider, l3)
             assert len(w) == 0
 
     @mock.patch(
         "scrapy.utils.misc.is_generator_with_return_value", new=_indentation_error
     )
-    def test_indentation_error(self):
+    def test_indentation_error(self, mock_spider):
         with warnings.catch_warnings(record=True) as w:
-            warn_on_generator_with_return_value(None, top_level_return_none)
+            warn_on_generator_with_return_value(mock_spider, top_level_return_none)
             assert len(w) == 1
             assert "Unable to determine" in str(w[0].message)
 
@@ -262,3 +281,32 @@ def cb(arg1, arg2):
 
         partial_cb = partial(cb, arg1=42)
         assert not is_generator_with_return_value(partial_cb)
+
+    def test_warn_on_generator_with_return_value_settings_disabled(self):
+        class MockSettings:
+            def __init__(self, settings_dict=None):
+                self.settings_dict = settings_dict or {}
+
+            def getbool(self, name, default=False):
+                return self.settings_dict.get(name, default)
+
+        class MockSpider:
+            def __init__(self):
+                self.settings = MockSettings({"WARN_ON_GENERATOR_RETURN_VALUE": False})
+
+        spider = MockSpider()
+
+        def gen_with_return():
+            yield 1
+            return "value"
+
+        with warnings.catch_warnings(record=True) as w:
+            warn_on_generator_with_return_value(spider, gen_with_return)
+            assert len(w) == 0
+
+        spider.settings.settings_dict["WARN_ON_GENERATOR_RETURN_VALUE"] = True
+
+        with warnings.catch_warnings(record=True) as w:
+            warn_on_generator_with_return_value(spider, gen_with_return)
+            assert len(w) == 1
+            assert "is a generator" in str(w[0].message)


Reviews:
user: login: auvipy
body: also check why the tests are failing
state: CHANGES_REQUESTED
author_association: NONE
submitted_at: 2025-03-19T08:38:47Z
user: login: MehrazRumman
body: I added the test cases !
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T18:53:21Z
user: login: auvipy
body: Looks much better after the tests Were added
state: APPROVED
author_association: NONE
submitted_at: 2025-03-19T19:08:09Z
user: login: Gallaecio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-19T19:31:20Z
user: login: MehrazRumman
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T19:40:16Z
user: login: MehrazRumman
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T19:41:31Z
user: login: Gallaecio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-19T19:55:07Z
user: login: MehrazRumman
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T06:24:06Z
user: login: auvipy
state: APPROVED
author_association: NONE
submitted_at: 2025-03-20T07:24:30Z
user: login: Gallaecio
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-20T08:48:29Z
user: login: Gallaecio
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-20T08:49:17Z
user: login: Gallaecio
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-20T10:29:31Z
user: login: auvipy
state: APPROVED
author_association: NONE
submitted_at: 2025-03-20T10:48:22Z
user: login: wRAR
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-20T10:53:12Z
user: login: wRAR
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-20T10:53:49Z
user: login: wRAR
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-20T10:54:15Z
user: login: MehrazRumman
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T11:33:29Z
user: login: MehrazRumman
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-20T11:34:47Z
user: login: wRAR
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-20T11:44:11Z

Review comments:
diff_hunk: @@ -280,24 +280,32 @@ def returns_none(return_node: ast.Return) -> bool:
 
 
 def warn_on_generator_with_return_value(
-    spider: Spider, callable: Callable[..., Any]
+    spider: Spider, func: Callable[..., Any]
 ) -> None:
     """
     Logs a warning if a callable is a generator function and includes
     a 'return' statement with a value different than None
     """
+    settings = getattr(spider, "settings", None)
+    getbool = getattr(settings, "getbool", None)
+    if (
+        settings
+        and callable(getbool)
+        and not getbool("WARN_ON_GENERATOR_RETURN_VALUE", True)
+    ):
+        return
path: scrapy/utils/misc.py
user: login: Gallaecio
body: Is this logic really necessary at run time? Or are the (pre-existing) tests taking shortcuts and causing some things to not be defined during the tests, when those things are always defined when actually running a crawl?
created_at: 2025-03-19T19:31:20Z
author_association: MEMBER
diff_hunk: @@ -280,24 +280,32 @@ def returns_none(return_node: ast.Return) -> bool:
 
 
 def warn_on_generator_with_return_value(
-    spider: Spider, callable: Callable[..., Any]
+    spider: Spider, func: Callable[..., Any]
 ) -> None:
     """
     Logs a warning if a callable is a generator function and includes
     a 'return' statement with a value different than None
     """
+    settings = getattr(spider, "settings", None)
+    getbool = getattr(settings, "getbool", None)
+    if (
+        settings
+        and callable(getbool)
+        and not getbool("WARN_ON_GENERATOR_RETURN_VALUE", True)
+    ):
+        return
path: scrapy/utils/misc.py
user: login: MehrazRumman
body: Good point !! I actually the defensive checks because unit test uses a dummy spider object . I wanted to avoid attribute error but you are right ! 
created_at: 2025-03-19T19:40:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -280,24 +280,32 @@ def returns_none(return_node: ast.Return) -> bool:
 
 
 def warn_on_generator_with_return_value(
-    spider: Spider, callable: Callable[..., Any]
+    spider: Spider, func: Callable[..., Any]
 ) -> None:
     """
     Logs a warning if a callable is a generator function and includes
     a 'return' statement with a value different than None
     """
+    settings = getattr(spider, "settings", None)
+    getbool = getattr(settings, "getbool", None)
+    if (
+        settings
+        and callable(getbool)
+        and not getbool("WARN_ON_GENERATOR_RETURN_VALUE", True)
+    ):
+        return
path: scrapy/utils/misc.py
user: login: MehrazRumman
body: I am fixing the issue !!
created_at: 2025-03-19T19:41:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -280,24 +280,32 @@ def returns_none(return_node: ast.Return) -> bool:
 
 
 def warn_on_generator_with_return_value(
-    spider: Spider, callable: Callable[..., Any]
+    spider: Spider, func: Callable[..., Any]
 ) -> None:
     """
     Logs a warning if a callable is a generator function and includes
     a 'return' statement with a value different than None
     """
+    settings = getattr(spider, "settings", None)
+    getbool = getattr(settings, "getbool", None)
+    if (
+        settings
+        and callable(getbool)
+        and not getbool("WARN_ON_GENERATOR_RETURN_VALUE", True)
+    ):
+        return
path: scrapy/utils/misc.py
user: login: Gallaecio
body: > Let me know if you need any help getting the existing tests to pass, your code looks fine.

This is what I meant by this ↑.

Your code seemed fine to me as it was. If you have trouble making the test more real so that they pass with your changes, do let me know, it may not be trivial to fix.
created_at: 2025-03-19T19:55:07Z
author_association: MEMBER
diff_hunk: @@ -280,24 +280,32 @@ def returns_none(return_node: ast.Return) -> bool:
 
 
 def warn_on_generator_with_return_value(
-    spider: Spider, callable: Callable[..., Any]
+    spider: Spider, func: Callable[..., Any]
 ) -> None:
     """
     Logs a warning if a callable is a generator function and includes
     a 'return' statement with a value different than None
     """
+    settings = getattr(spider, "settings", None)
+    getbool = getattr(settings, "getbool", None)
+    if (
+        settings
+        and callable(getbool)
+        and not getbool("WARN_ON_GENERATOR_RETURN_VALUE", True)
+    ):
+        return
path: scrapy/utils/misc.py
user: login: MehrazRumman
body: I get your point now ! I just gave it a try to fix the test case . I introduce a mockspider , setting attribute that has a getbool method and change all `None` to `MockSpider` .  If its not ok then , I certainly need your help to fix the test . 😄 
created_at: 2025-03-20T06:24:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -286,6 +286,8 @@ def warn_on_generator_with_return_value(
     Logs a warning if a callable is a generator function and includes
     a 'return' statement with a value different than None
     """
+    if not spider.settings.getbool("WARN_ON_GENERATOR_RETURN_VALUE", True):
+        return
path: scrapy/utils/misc.py
user: login: Gallaecio
body: Since the setting exists in `default_settings.py`, I believe it is safe to remove `True`:

```suggestion
    if not spider.settings.getbool("WARN_ON_GENERATOR_RETURN_VALUE"):
        return
```
created_at: 2025-03-20T08:48:29Z
author_association: MEMBER
diff_hunk: @@ -2047,6 +2047,21 @@ also used by :class:`~scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware
 if :setting:`ROBOTSTXT_USER_AGENT` setting is ``None`` and
 there is no overriding User-Agent header specified for the request.
 
+.. setting:: WARN_ON_GENERATOR_RETURN_VALUE
+
+WARN_ON_GENERATOR_RETURN_VALUE
+------------------------------
+
+Default: ``True``
+
+Type: ``bool``
path: docs/topics/settings.rst
user: login: wRAR
body: We don't document this in this way for ohter settings (and it should be obvious in this case)
created_at: 2025-03-20T10:53:12Z
author_association: MEMBER
diff_hunk: @@ -2047,6 +2047,21 @@ also used by :class:`~scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware
 if :setting:`ROBOTSTXT_USER_AGENT` setting is ``None`` and
 there is no overriding User-Agent header specified for the request.
 
+.. setting:: WARN_ON_GENERATOR_RETURN_VALUE
+
+WARN_ON_GENERATOR_RETURN_VALUE
+------------------------------
+
+Default: ``True``
+
+Type: ``bool``
+
+When enabled, Scrapy will warn if generator-based callback methods (like ``parse``) contain return statements with non-``None`` values. This helps detect potential mistakes in spider development.
+
+Disable this setting to:
+- Prevent syntax errors when dynamically modifying generator function source code during runtime
+- Skip AST parsing of callback functions
+- Improve performance in auto-reloading development environments
path: docs/topics/settings.rst
user: login: wRAR
body: Please check how is it rendered by running e.g. `tox -e docs` and opening the result (it's not rendered as a list).
created_at: 2025-03-20T10:53:49Z
author_association: MEMBER
diff_hunk: @@ -2047,6 +2047,21 @@ also used by :class:`~scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware
 if :setting:`ROBOTSTXT_USER_AGENT` setting is ``None`` and
 there is no overriding User-Agent header specified for the request.
 
+.. setting:: WARN_ON_GENERATOR_RETURN_VALUE
+
+WARN_ON_GENERATOR_RETURN_VALUE
+------------------------------
+
+Default: ``True``
+
+Type: ``bool``
+
+When enabled, Scrapy will warn if generator-based callback methods (like ``parse``) contain return statements with non-``None`` values. This helps detect potential mistakes in spider development.
path: docs/topics/settings.rst
user: login: wRAR
body: We wrap lines in the docs (to about 80 chars).
created_at: 2025-03-20T10:54:15Z
author_association: MEMBER
diff_hunk: @@ -2047,6 +2047,21 @@ also used by :class:`~scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware
 if :setting:`ROBOTSTXT_USER_AGENT` setting is ``None`` and
 there is no overriding User-Agent header specified for the request.
 
+.. setting:: WARN_ON_GENERATOR_RETURN_VALUE
+
+WARN_ON_GENERATOR_RETURN_VALUE
+------------------------------
+
+Default: ``True``
+
+Type: ``bool``
+
+When enabled, Scrapy will warn if generator-based callback methods (like ``parse``) contain return statements with non-``None`` values. This helps detect potential mistakes in spider development.
path: docs/topics/settings.rst
user: login: MehrazRumman
body: <img width="829" alt="Screenshot 2025-03-20 at 5 32 35 PM" src="https://github.com/user-attachments/assets/4a74db7a-2ff2-45c2-af8e-df0471389e82" />
this is the out put after running `tox -e docs`
created_at: 2025-03-20T11:33:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -2047,6 +2047,21 @@ also used by :class:`~scrapy.downloadermiddlewares.robotstxt.RobotsTxtMiddleware
 if :setting:`ROBOTSTXT_USER_AGENT` setting is ``None`` and
 there is no overriding User-Agent header specified for the request.
 
+.. setting:: WARN_ON_GENERATOR_RETURN_VALUE
+
+WARN_ON_GENERATOR_RETURN_VALUE
+------------------------------
+
+Default: ``True``
+
+Type: ``bool``
+
+When enabled, Scrapy will warn if generator-based callback methods (like ``parse``) contain return statements with non-``None`` values. This helps detect potential mistakes in spider development.
path: docs/topics/settings.rst
user: login: MehrazRumman
body: @wRAR  is it ok now ? Or I need to update it further ? 
created_at: 2025-03-20T11:34:47Z
author_association: CONTRIBUTOR

PR comments:
user: login: codecov[bot]
created_at: 2025-03-18T19:46:50Z
body: ## [Codecov](https://app.codecov.io/gh/scrapy/scrapy/pull/6738?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapy) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 90.67%. Comparing base [(`8729247`)](https://app.codecov.io/gh/scrapy/scrapy/commit/872924721344502cca92a72ce68d5f78a9b9e5bc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapy) to head [(`07675bf`)](https://app.codecov.io/gh/scrapy/scrapy/commit/07675bf6e8d9b4040dee6164637b8592bb97c681?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapy).
> Report is 2 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           master    #6738   +/-   ##
=======================================
  Coverage   90.67%   90.67%           
=======================================
  Files         162      162           
  Lines       12129    12133    +4     
  Branches     1567     1568    +1     
=======================================
+ Hits        10998    11002    +4     
  Misses        829      829           
  Partials      302      302           
```

| [Files with missing lines](https://app.codecov.io/gh/scrapy/scrapy/pull/6738?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapy) | Coverage Δ | |
|---|---|---|
| [scrapy/settings/default\_settings.py](https://app.codecov.io/gh/scrapy/scrapy/pull/6738?src=pr&el=tree&filepath=scrapy%2Fsettings%2Fdefault_settings.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapy#diff-c2NyYXB5L3NldHRpbmdzL2RlZmF1bHRfc2V0dGluZ3MucHk=) | `100.00% <100.00%> (ø)` | |
| [scrapy/utils/misc.py](https://app.codecov.io/gh/scrapy/scrapy/pull/6738?src=pr&el=tree&filepath=scrapy%2Futils%2Fmisc.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapy#diff-c2NyYXB5L3V0aWxzL21pc2MucHk=) | `100.00% <100.00%> (ø)` | |

... and [1 file with indirect coverage changes](https://app.codecov.io/gh/scrapy/scrapy/pull/6738/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapy)

</details>
<details><summary>🚀 New features to boost your workflow: </summary>

- ❄ [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
author_association: NONE
user: login: MehrazRumman
created_at: 2025-03-18T19:47:35Z
body: I will add the test too !! 
author_association: CONTRIBUTOR
user: login: Gallaecio
created_at: 2025-03-19T09:23:18Z
body: I think the test failures may be due to some shortcuts taken in the current tests for the warning, i.e. the spider not being set up properly. Let me know if you need any help getting the existing tests to pass, your code looks fine.
author_association: MEMBER
user: login: MehrazRumman
created_at: 2025-03-19T19:00:47Z
body: @auvipy   Can you help me to review this PR ?
author_association: CONTRIBUTOR
user: login: Gallaecio
created_at: 2025-03-20T08:49:45Z
body: Could you add an entry about this new setting to  `settings.rst`?
author_association: MEMBER
user: login: MehrazRumman
created_at: 2025-03-20T08:51:16Z
body: > Could you add an entry about this new setting to `settings.rst`?

Ok . I will @Gallaecio ! Thanks . 
author_association: CONTRIBUTOR
user: login: wRAR
created_at: 2025-03-20T11:44:02Z
body: Thanks!
author_association: MEMBER
user: login: MehrazRumman
created_at: 2025-03-20T11:45:47Z
body: Thanks for the guidelines @Gallaecio & @wRAR  ❤️ 
author_association: CONTRIBUTOR