fix tests for autodoc novalue option

In the tests for autodoc the Options are of type struct,
while in the code there is a special autodoc.Options class,
which is a dict.

So "novalue" in self.options doesn't work,
but self.options.novalue does work for both.

Additionally the logic for autoattribute was wrong and is fixed now.
This commit is contained in:
Johannes Dewender committed 2013-01-24 18:17:53 +01:00
1 parent 391f99d13a
commit ffb825d733
2 files changed
+3 -2

No files matched your search

+2 -2
View File
@@ -1106,7 +1106,7 @@ class DataDocumenter(ModuleLevelDocumenter):
def add_directive_header(self, sig):
ModuleLevelDocumenter.add_directive_header(self, sig)
if not "novalue" in self.options:
if not self.options.novalue:
try:
objrepr = safe_repr(self.object)
except ValueError:
@@ -1221,7 +1221,7 @@ class AttributeDocumenter(ClassLevelDocumenter):
def add_directive_header(self, sig):
ClassLevelDocumenter.add_directive_header(self, sig)
if not self._datadescriptor or "novalue" in self.options:
if not self._datadescriptor and not self.options.novalue:
try:
objrepr = safe_repr(self.object)
except ValueError:
+1
View File
@@ -38,6 +38,7 @@ def setup_module():
special_members = False,
show_inheritance = False,
noindex = False,
novalue = False,
synopsis = '',
platform = '',
deprecated = False,