Show More
@@ -880,7 +880,7 b' def doctest_reload():' | |||
|
880 | 880 | |
|
881 | 881 | This routine: |
|
882 | 882 | |
|
883 | - reloads doctest | |
|
883 | - imports doctest but does NOT reload it (see below). | |
|
884 | 884 | |
|
885 | 885 | - resets its global 'master' attribute to None, so that multiple uses of |
|
886 | 886 | the module interactively don't produce cumulative reports. |
@@ -889,20 +889,20 b' def doctest_reload():' | |||
|
889 | 889 | modified displayhook. Doctest expects the default displayhook behavior |
|
890 | 890 | deep down, so our modification breaks it completely. For this reason, a |
|
891 | 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 | 893 |
|
|
894 | import doctest | |
|
895 | reload(doctest) | |
|
896 | doctest.master=None | |
|
894 | Note | |
|
895 | ---- | |
|
897 | 896 |
|
|
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) | |
|
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.""" | |
|
902 | ||
|
903 | import doctest | |
|
904 | doctest.master = None | |
|
905 | doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run) | |
|
906 | 906 | |
|
907 | 907 | #---------------------------------------------------------------------------- |
|
908 | 908 | class HomeDirError(Error): |
General Comments 0
You need to be logged in to leave comments.
Login now