summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTakayuki Shimizukawa <shimizukawa@gmail.com>2013-12-15 14:16:53 +0900
committerTakayuki Shimizukawa <shimizukawa@gmail.com>2013-12-15 14:16:53 +0900
commita8fc938d1b9fb1be7979da8b8236aba287fc082e (patch)
tree751d6a1e72f6a59fd036eac63cf01d3c708857a7 /tests
parent95a07fe282a084862daca26a0ed781ab498395a8 (diff)
downloadsphinx-git-a8fc938d1b9fb1be7979da8b8236aba287fc082e.tar.gz
Drop python-2.5 and remove 2.4,2.5 support codes
Diffstat (limited to 'tests')
-rw-r--r--tests/test_autodoc.py11
-rw-r--r--tests/test_intl.py6
-rw-r--r--tests/test_versioning.py1
-rw-r--r--tests/test_websupport.py7
-rw-r--r--tests/util.py7
5 files changed, 7 insertions, 25 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py
index 63c341f1b..7e60c5fb3 100644
--- a/tests/test_autodoc.py
+++ b/tests/test_autodoc.py
@@ -737,12 +737,8 @@ def _funky_classmethod(name, b, c, d, docstring=None):
some arguments."""
def template(cls, a, b, c, d=4, e=5, f=6):
return a, b, c, d, e, f
- if sys.version_info >= (2, 5):
- from functools import partial
- function = partial(template, b=b, c=c, d=d)
- else:
- def function(cls, a, e=5, f=6):
- return template(a, b, c, d, e, f)
+ from functools import partial
+ function = partial(template, b=b, c=c, d=d)
function.__name__ = name
function.__doc__ = docstring
return classmethod(function)
@@ -774,10 +770,9 @@ class Class(Base):
#: should be documented -- süß
attr = 'bar'
+ @property
def prop(self):
"""Property."""
- # stay 2.4 compatible (docstring!)
- prop = property(prop, doc="Property.")
docattr = 'baz'
"""should likewise be documented -- süß"""
diff --git a/tests/test_intl.py b/tests/test_intl.py
index c98220890..c241c0aed 100644
--- a/tests/test_intl.py
+++ b/tests/test_intl.py
@@ -16,8 +16,6 @@ from StringIO import StringIO
from subprocess import Popen, PIPE
from xml.etree import ElementTree
-from sphinx.util.pycompat import relpath
-
from util import test_roots, path, with_app, SkipTest
@@ -49,7 +47,7 @@ def setup_module():
for f in [f for f in files if f.endswith('.po')]:
po = dirpath / f
mo = root / 'xx' / 'LC_MESSAGES' / (
- relpath(po[:-3], root) + '.mo')
+ os.path.relpath(po[:-3], root) + '.mo')
if not mo.parent.exists():
mo.parent.makedirs()
try:
@@ -75,7 +73,7 @@ def teardown_module():
def elem_gettexts(elem):
def itertext(self):
# this function copied from Python-2.7 'ElementTree.itertext'.
- # for compatibility to Python-2.5, 2.6, 3.1
+ # for compatibility to Python-2.6, 3.1
tag = self.tag
if not isinstance(tag, basestring) and tag is not None:
return
diff --git a/tests/test_versioning.py b/tests/test_versioning.py
index 6469a33cc..5cff92ffd 100644
--- a/tests/test_versioning.py
+++ b/tests/test_versioning.py
@@ -15,7 +15,6 @@ from docutils.parsers.rst.directives.html import MetaBody
from sphinx import addnodes
from sphinx.versioning import add_uids, merge_doctrees, get_ratio
-from sphinx.util.pycompat import all
from util import test_root, TestApp
diff --git a/tests/test_websupport.py b/tests/test_websupport.py
index 611a131ac..d950a36c3 100644
--- a/tests/test_websupport.py
+++ b/tests/test_websupport.py
@@ -11,12 +11,7 @@
import os
from StringIO import StringIO
-
-try:
- from functools import wraps
-except ImportError:
- # functools is new in 2.5
- wraps = lambda f: (lambda w: w)
+from functools import wraps
from sphinx.websupport import WebSupport
from sphinx.websupport.errors import DocumentNotFoundError, \
diff --git a/tests/util.py b/tests/util.py
index 4ba89030a..a2f345bf8 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -13,12 +13,7 @@ import tempfile
import shutil
import re
from codecs import open
-
-try:
- from functools import wraps
-except ImportError:
- # functools is new in 2.4
- wraps = lambda f: (lambda w: w)
+from functools import wraps
from sphinx import application
from sphinx.theming import Theme