summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2020-10-25 10:27:43 +0100
committerMatthias Geier <Matthias.Geier@gmail.com>2020-10-25 10:27:43 +0100
commit82c83ed478618c9b97f1cbf7a24214ee433fa891 (patch)
tree390650fac4e1318b2be27422c4b5542e89e05cba
parentda4f091c211ccf30a8a7591c4881027fe1d74c35 (diff)
downloadsphinx-git-82c83ed478618c9b97f1cbf7a24214ee433fa891.tar.gz
autodoc: Add test for single-string __slots__
-rw-r--r--tests/roots/test-ext-autodoc/target/slots.py4
-rw-r--r--tests/test_ext_autodoc.py8
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/roots/test-ext-autodoc/target/slots.py b/tests/roots/test-ext-autodoc/target/slots.py
index 44e750320..17e469cac 100644
--- a/tests/roots/test-ext-autodoc/target/slots.py
+++ b/tests/roots/test-ext-autodoc/target/slots.py
@@ -2,6 +2,10 @@ class Foo:
__slots__ = ['attr']
+class FooSingleString:
+ __slots__ = 'attr'
+
+
class Bar:
__slots__ = {'attr1': 'docstring of attr1',
'attr2': 'docstring of attr2',
diff --git a/tests/test_ext_autodoc.py b/tests/test_ext_autodoc.py
index 9cb54de5b..c0676f23f 100644
--- a/tests/test_ext_autodoc.py
+++ b/tests/test_ext_autodoc.py
@@ -1205,6 +1205,14 @@ def test_slots(app):
' .. py:attribute:: Foo.attr',
' :module: target.slots',
'',
+ '',
+ '.. py:class:: FooSingleString()',
+ ' :module: target.slots',
+ '',
+ '',
+ ' .. py:attribute:: FooSingleString.attr',
+ ' :module: target.slots',
+ '',
]