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,20 +889,20 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 |
|
|
893 | ||
894 | import doctest |
|
894 | Note | |
895 | reload(doctest) |
|
895 | ---- | |
896 | doctest.master=None |
|
|||
897 |
|
|
896 | ||
898 | try: |
|
897 | This function *used to* reload doctest, but this has been disabled because | |
899 | doctest.DocTestRunner |
|
898 | reloading doctest unconditionally can cause massive breakage of other | |
900 | except AttributeError: |
|
899 | doctest-dependent modules already in memory, such as those for IPython's | |
901 | # This is only for python 2.3 compatibility, remove once we move to |
|
900 | own testing system. The name wasn't changed to avoid breaking people's | |
902 | # 2.4 only. |
|
901 | code, but the reload call isn't actually made anymore.""" | |
903 | pass |
|
902 | ||
904 | else: |
|
903 | import doctest | |
905 | doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run) |
|
904 | doctest.master = None | |
|
905 | doctest.DocTestRunner.run = dhook_wrap(doctest.DocTestRunner.run) | |||
906 |
|
906 | |||
907 | #---------------------------------------------------------------------------- |
|
907 | #---------------------------------------------------------------------------- | |
908 | class HomeDirError(Error): |
|
908 | class HomeDirError(Error): |
General Comments 0
You need to be logged in to leave comments.
Login now