Skip to content

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

add test for invalid option

Elias Dorneles23b3336c1feb
diff --git a/tests/test_exporters.py b/tests/test_exporters.py
index 00352f61e..61a0229a4 100644
--- a/tests/test_exporters.py
+++ b/tests/test_exporters.py
@@ -90,6 +90,10 @@ class PythonItemExporterTest(BaseItemExporterTest):
def _get_exporter(self, **kwargs):
return PythonItemExporter(binary=False, **kwargs)
+ def test_invalid_option(self):
+ with self.assertRaisesRegexp(TypeError, "Unexpected options: invalid_option"):
+ PythonItemExporter(invalid_option='something')
+
def test_nested_item(self):
i1 = TestItem(name=u'Joseph', age='22')
i2 = dict(name=u'Maria', age=i1)