summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorJohannes Dewender <bitbucket@JonnyJD.net>2013-01-24 18:17:53 +0100
committerJohannes Dewender <bitbucket@JonnyJD.net>2013-01-24 18:17:53 +0100
commit9eb441dfa22d3cb5b67c2cdd0d0e834f7beb5386 (patch)
tree1572f11ab35429329f662a086a808d720920741d /sphinx/ext/autodoc.py
parent8e722f430d2d86bbbf53e963758193a96c25f2dc (diff)
downloadsphinx-9eb441dfa22d3cb5b67c2cdd0d0e834f7beb5386.tar.gz
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.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 4181818b..2bdba7e4 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -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: