Permalink
Browse files

Small cleanups and documentation to testing support code.

Closes #324: I checked and by now all the tools in our testing/
directory are really used, over the last few months we cleaned up most
of what wasn't used.
  • Loading branch information...
1 parent b44cdc3 commit a1b74bc4462e527896dfe6dfbb6b02ed2a9167b7 @fperez fperez committed Nov 30, 2011
Showing with 24 additions and 2 deletions.
  1. +6 −1 IPython/testing/nosepatch.py
  2. +18 −1 IPython/testing/skipdoctest.py
@@ -3,7 +3,12 @@
By default, nose's ismethod() fails for static methods.
Once this is fixed in upstream nose we can disable it.
-Note: merely importing this module causes the monkeypatch to be applied."""
+Notes:
+
+- As of Nose 1.0.0, the problem persists so this monkeypatch is still
+needed.
+
+- Merely importing this module causes the monkeypatch to be applied."""
#-----------------------------------------------------------------------------
# Copyright (C) 2009-2011 The IPython Development Team
@@ -1,11 +1,27 @@
-"""This decorator marks that a doctest should be skipped.
+"""Decorators marks that a doctest should be skipped, for both python 2 and 3.
The IPython.testing.decorators module triggers various extra imports, including
numpy and sympy if they're present. Since this decorator is used in core parts
of IPython, it's in a separate module so that running IPython doesn't trigger
those imports."""
+
+#-----------------------------------------------------------------------------
+# Copyright (C) 2009-2011 The IPython Development Team
+#
+# Distributed under the terms of the BSD License. The full license is in
+# the file COPYING, distributed as part of this software.
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# Imports
+#-----------------------------------------------------------------------------
+
import sys
+#-----------------------------------------------------------------------------
+# Decorators
+#-----------------------------------------------------------------------------
+
def skip_doctest(f):
"""Decorator - mark a function or method for skipping its doctest.
@@ -15,6 +31,7 @@ def skip_doctest(f):
f.skip_doctest = True
return f
+
def skip_doctest_py3(f):
"""Decorator - skip the doctest under Python 3."""
f.skip_doctest = (sys.version_info[0] >= 3)

0 comments on commit a1b74bc

Please sign in to comment.