Skip to content

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

Fix a recent mock regression by not using it in a test

Julia Medinad3d61fde870b
diff --git a/tests/test_settings/__init__.py b/tests/test_settings/__init__.py
index 5fa22ca77..54b834aa0 100644
--- a/tests/test_settings/__init__.py
+++ b/tests/test_settings/__init__.py
@@ -219,12 +219,9 @@ class SettingsTest(unittest.TestCase):
"Trying to modify an immutable Settings object")
def test_frozencopy(self):
- with mock.patch.object(self.settings, 'copy') as mock_copy:
- with mock.patch.object(mock_copy, 'freeze') as mock_freeze:
- mock_object = self.settings.frozencopy()
- mock_copy.assert_call_once()
- mock_freeze.assert_call_once()
- self.assertEqual(mock_object, mock_copy.return_value)
+ frozencopy = self.settings.frozencopy()
+ self.assertTrue(frozencopy.frozen)
+ self.assertIsNot(frozencopy, self.settings)
def test_deprecated_attribute_overrides(self):
self.settings.set('BAR', 'fuz', priority='cmdline')