diff --git a/tests/test_downloadermiddleware_httpcache.py b/tests/test_downloadermiddleware_httpcache.py index f80eff3e6..ec4e87ffb 100644 --- a/tests/test_downloadermiddleware_httpcache.py +++ b/tests/test_downloadermiddleware_httpcache.py @@ -566,7 +566,3 @@ class RFC2616PolicyTest(DefaultStorageTest): res2 = self._process_requestresponse(mw, req0, None) self.assertEqualResponse(res1, res2) assert "cached" in res2.flags - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_downloadermiddleware_redirect.py b/tests/test_downloadermiddleware_redirect.py index e37da9715..7b19ab781 100644 --- a/tests/test_downloadermiddleware_redirect.py +++ b/tests/test_downloadermiddleware_redirect.py @@ -1314,7 +1314,3 @@ def test_meta_refresh_schemes(url, location, target): else: assert isinstance(redirect, Request) assert redirect.url == target - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_downloadermiddleware_retry.py b/tests/test_downloadermiddleware_retry.py index c99f19b03..9b39b84d9 100644 --- a/tests/test_downloadermiddleware_retry.py +++ b/tests/test_downloadermiddleware_retry.py @@ -643,7 +643,3 @@ class GetRetryRequestTest(unittest.TestCase): f"{stats_key}/reason_count/{expected_reason}", ): self.assertEqual(spider.crawler.stats.get_value(stat), 1) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_exporters.py b/tests/test_exporters.py index fa9389044..0f70887af 100644 --- a/tests/test_exporters.py +++ b/tests/test_exporters.py @@ -699,7 +699,3 @@ class CustomExporterItemTest(unittest.TestCase): class CustomExporterDataclassTest(CustomExporterItemTest): item_class = TestDataClass - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_http_request.py b/tests/test_http_request.py index 9997b7ab3..d020a8911 100644 --- a/tests/test_http_request.py +++ b/tests/test_http_request.py @@ -1717,7 +1717,3 @@ class JsonRequestTest(RequestTest): def tearDown(self): warnings.resetwarnings() super().tearDown() - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_item.py b/tests/test_item.py index 13243b67f..3f10a724d 100644 --- a/tests/test_item.py +++ b/tests/test_item.py @@ -296,7 +296,3 @@ class ItemMetaClassCellRegression(unittest.TestCase): # TypeError: __class__ set to # defining 'MyItem' as super().__init__(*args, **kwargs) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_loader.py b/tests/test_loader.py index aca428bbe..824d7aecf 100644 --- a/tests/test_loader.py +++ b/tests/test_loader.py @@ -586,7 +586,3 @@ class FunctionProcessorTestCase(unittest.TestCase): lo.add_value("foo", " bar ") lo.add_value("foo", [" asdf ", " qwerty "]) self.assertEqual(dict(lo.load_item()), {"foo": ["BAR", "ASDF", "QWERTY"]}) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_loader_deprecated.py b/tests/test_loader_deprecated.py index 4bf22f6a0..8d4bd6bc1 100644 --- a/tests/test_loader_deprecated.py +++ b/tests/test_loader_deprecated.py @@ -715,7 +715,3 @@ class FunctionProcessorTestCase(unittest.TestCase): lo.add_value("foo", " bar ") lo.add_value("foo", [" asdf ", " qwerty "]) self.assertEqual(dict(lo.load_item()), {"foo": ["BAR", "ASDF", "QWERTY"]}) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_logformatter.py b/tests/test_logformatter.py index 5a92521cc..61a9f3f8d 100644 --- a/tests/test_logformatter.py +++ b/tests/test_logformatter.py @@ -234,7 +234,3 @@ class ShowOrSkipMessagesTestCase(TwistedTestCase): self.assertNotIn("Scraped from <200 http://127.0.0.1:", str(lc)) self.assertNotIn("Crawled (200)