Skip to content

Commit

Permalink
TST fix tests that became broken after adding top-level imports and s…
Browse files Browse the repository at this point in the history
…witching 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.
  • Loading branch information
kmike committed Apr 15, 2014
1 parent 11e6211 commit c3426e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
[pytest]
usefixtures = chdir setlog
python_files=test_*.py __init__.py
addopts = --doctest-modules
addopts = --doctest-modules --assert=plain

0 comments on commit c3426e9

Please sign in to comment.