Show More
@@ -0,0 +1,11 | |||||
|
1 | """Add some assert methods to nose.tools. These were added in Python 2.7/3.1, so | |||
|
2 | once we stop testing on Python 2.6, this file can be removed. | |||
|
3 | """ | |||
|
4 | ||||
|
5 | import nose.tools as nt | |||
|
6 | ||||
|
7 | def assert_in(item, collection): | |||
|
8 | assert item in collection, '%r not in %r' % (item, collection) | |||
|
9 | ||||
|
10 | if not hasattr(nt, 'assert_in'): | |||
|
11 | nt.assert_in = assert_in |
@@ -40,6 +40,11 import warnings | |||||
40 | # it for actual use. This should get into nose upstream, but its release cycle |
|
40 | # it for actual use. This should get into nose upstream, but its release cycle | |
41 | # is slow and we need it for our parametric tests to work correctly. |
|
41 | # is slow and we need it for our parametric tests to work correctly. | |
42 | from IPython.testing import nosepatch |
|
42 | from IPython.testing import nosepatch | |
|
43 | ||||
|
44 | # Monkeypatch extra assert methods into nose.tools if they're not already there. | |||
|
45 | # This can be dropped once we no longer test on Python 2.6 | |||
|
46 | from IPython.testing import nose_assert_methods | |||
|
47 | ||||
43 | # Now, proceed to import nose itself |
|
48 | # Now, proceed to import nose itself | |
44 | import nose.plugins.builtin |
|
49 | import nose.plugins.builtin | |
45 | from nose.plugins.xunit import Xunit |
|
50 | from nose.plugins.xunit import Xunit |
General Comments 0
You need to be logged in to leave comments.
Login now