From c3426e952bb72f715ee9d7c8aaf4aa8198b3f624 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Tue, 15 Apr 2014 06:54:14 +0600 Subject: [PATCH] TST fix tests that became broken after adding top-level imports and switching to py.test. py.test replaces AssertionError exception with its own subclass in an import hook. For some reason when top-level shortcuts were added "except AssertionError" in contracts.__init__ meant "except py.test AssertionError" while scrapy.exceptions.ContractFail was still a subclass of a builtin AssertionError, so Contracts reported errors instead of failures and this made tests in test_contracts.py fail. For now - just disable fancy py.test asserts. --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 8d3bc91a5..f034bf233 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,4 +2,4 @@ [pytest] usefixtures = chdir setlog python_files=test_*.py __init__.py -addopts = --doctest-modules +addopts = --doctest-modules --assert=plain