From fd074fb59894a75abfabc7d2eff4ba7112248f24 2011-09-07 11:22:32 From: Thomas Kluyver Date: 2011-09-07 11:22:32 Subject: [PATCH] Don't monkeypatch nose in Python 3, as it must be a newer version. --- diff --git a/IPython/testing/nosepatch.py b/IPython/testing/nosepatch.py index 2458e39..c630fb7 100644 --- a/IPython/testing/nosepatch.py +++ b/IPython/testing/nosepatch.py @@ -17,6 +17,7 @@ Note: merely importing this module causes the monkeypatch to be applied.""" #----------------------------------------------------------------------------- import unittest +import sys import nose.loader from inspect import ismethod, isfunction @@ -64,5 +65,7 @@ def getTestCaseNames(self, testCaseClass): ########################################################################## # Apply monkeypatch here -nose.loader.TestLoader.getTestCaseNames = getTestCaseNames +# Python 3 must be running with newer version of Nose, so don't touch anything. +if sys.version_info[0] < 3: + nose.loader.TestLoader.getTestCaseNames = getTestCaseNames ##########################################################################