New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doctest confused by super-instances in class-dicts #39977
Comments
In Python 2.3.3, doctest chokes on classes which Traceback (most recent call last):
File "/ttt/private/tanzer/temp/confuse_doctest.py",
line 14, in ?
import doctest, confuse_doctest
File
"/Node/tttprime/ttt/private/tanzer/temp/confuse_doctest.py",
line 15, in ?
doctest.testmod(confuse_doctest)
File "/usr/lib/python2.3/doctest.py", line 1148, in
testmod
f, t = tester.rundict(m.__dict__, name, m)
File "/usr/lib/python2.3/doctest.py", line 908, in
rundict
f2, t2 = self.__runone(value, name + "." + thisname)
File "/usr/lib/python2.3/doctest.py", line 1069, in
__runone
return self.rundoc(target, name)
File "/usr/lib/python2.3/doctest.py", line 828, in rundoc
f2, t2 = self.run__test__(d, name)
File "/usr/lib/python2.3/doctest.py", line 937, in
run__test__
raise TypeError("Tester.run__test__: values in "
TypeError: Tester.run__test__: values in dict must be
strings, functions, methods, or classes; <super: <class
'A'>, NULL> A simple example triggering the bug is attached. Python 2.3.3 (#2, Jan 13 2004, 00:47:05) |
Logged In: YES I patched doctest.py to avoid the traceback (see attached The second chunk of the patch improves the traceback given |
Logged In: YES The problem is that inspect.get_class_attrs()'s "method" |
Logged In: YES This got fixed as part of the massive doctest refactoring for |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: