summaryrefslogtreecommitdiff
path: root/tests/test_py_domain.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-09-21 17:17:02 +0200
committerGeorg Brandl <georg@python.org>2014-09-21 17:17:02 +0200
commitd47a7587f9813f2366e2077be051116291bf930e (patch)
tree08d92669490358b284d2edd9ba4d61b64c52042a /tests/test_py_domain.py
parentc5dfd5c7328fe642d0ca2bb51be58253326af17f (diff)
downloadsphinx-git-d47a7587f9813f2366e2077be051116291bf930e.tar.gz
Complete test suite overhaul.
* rename a few test modules to make the names more consistent * do not copy/use Sphinx from build/ (unnecessary without 2to3) * use a temporary dir for *all* test projects, the source tree will stay pristine that way (default is tests/build) * speed up tests by ~3x by splitting up test projects and avoiding rebuilds
Diffstat (limited to 'tests/test_py_domain.py')
-rw-r--r--tests/test_py_domain.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/test_py_domain.py b/tests/test_py_domain.py
deleted file mode 100644
index 87f6eb98b..000000000
--- a/tests/test_py_domain.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- test_py_domain
- ~~~~~~~~~~~~~~
-
- Tests the Python Domain
-
- :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
- :license: BSD, see LICENSE for details.
-"""
-
-from six import text_type
-
-from sphinx import addnodes
-from sphinx.domains.python import py_sig_re, _pseudo_parse_arglist
-
-
-def parse(sig):
- m = py_sig_re.match(sig)
- if m is None:
- raise ValueError
- name_prefix, name, arglist, retann = m.groups()
- signode = addnodes.desc_signature(sig, '')
- _pseudo_parse_arglist(signode, arglist)
- return signode.astext()
-
-
-def test_function_signatures():
-
- rv = parse('func(a=1) -> int object')
- assert text_type(rv) == u'a=1'
-
- rv = parse('func(a=1, [b=None])')
- assert text_type(rv) == u'a=1, [b=None]'
-
- rv = parse('func(a=1[, b=None])')
- assert text_type(rv) == u'a=1, [b=None]'
-
- rv = parse("compile(source : string, filename, symbol='file')")
- assert text_type(rv) == u"source : string, filename, symbol='file'"
-
- rv = parse('func(a=[], [b=None])')
- assert text_type(rv) == u'a=[], [b=None]'
-
- rv = parse('func(a=[][, b=None])')
- assert text_type(rv) == u'a=[], [b=None]'