##// END OF EJS Templates
Prevent forced reloading of doctest which was breaking lots of tests....
Fernando Perez -
Show More
@@ -880,7 +880,7 b' def doctest_reload():'
880
880
881 This routine:
881 This routine:
882
882
883 - reloads doctest
883 - imports doctest but does NOT reload it (see below).
884
884
885 - resets its global 'master' attribute to None, so that multiple uses of
885 - resets its global 'master' attribute to None, so that multiple uses of
886 the module interactively don't produce cumulative reports.
886 the module interactively don't produce cumulative reports.
@@ -889,19 +889,19 b' def doctest_reload():'
889 modified displayhook. Doctest expects the default displayhook behavior
889 modified displayhook. Doctest expects the default displayhook behavior
890 deep down, so our modification breaks it completely. For this reason, a
890 deep down, so our modification breaks it completely. For this reason, a
891 hard monkeypatch seems like a reasonable solution rather than asking
891 hard monkeypatch seems like a reasonable solution rather than asking
892 users to manually use a different doctest runner when under IPython."""
892 users to manually use a different doctest runner when under IPython.
893
894 Note
895 ----
896
897 This function *used to* reload doctest, but this has been disabled because
898 reloading doctest unconditionally can cause massive breakage of other
899 doctest-dependent modules already in memory, such as those for IPython's
900 own testing system. The name wasn't changed to avoid breaking people's
901 code, but the reload call isn't actually made anymore."""
893
902
894 import doctest
903 import doctest
895 reload(doctest)
896 doctest.master=None
904 doctest.master = None
897
898 try:
899 doctest.DocTestRunner
900 except AttributeError:
901 # This is only for python 2.3 compatibility, remove once we move to
902 # 2.4 only.
903 pass
904 else:
905 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
905 doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run)
906
906
907 #----------------------------------------------------------------------------
907 #----------------------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now