summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2014-01-06 12:36:29 +0100
committerJulian Andres Klode <jak@debian.org>2014-01-06 12:36:29 +0100
commitf6c94dbe9cbfa645b19832842183e248f940f829 (patch)
tree271239a095a573a8fbef75fec274f6d1f965ffea
parentaf7a03182edaf58a18e1821d172c0f0dd869c898 (diff)
downloadpython-apt-f6c94dbe9cbfa645b19832842183e248f940f829.tar.gz
tests: Remove checks for Python older than 2.7
This simplifies the test code a tiny bit.
-rw-r--r--tests/test_all.py11
-rw-r--r--tests/test_auth.py9
-rw-r--r--tests/test_size_to_str.py9
3 files changed, 5 insertions, 24 deletions
diff --git a/tests/test_all.py b/tests/test_all.py
index 180712f9..6eebb0cf 100644
--- a/tests/test_all.py
+++ b/tests/test_all.py
@@ -10,8 +10,7 @@ import unittest.runner
import unittest
import sys
-# workaround for py3.2 that apparently does not have this anymore
-# it has "abiflags"
+# Python 3 only provides abiflags since 3.2
if not hasattr(sys, "pydebug"):
if sys.abiflags.startswith("d"):
sys.pydebug = True
@@ -27,12 +26,8 @@ def get_library_dir():
from distutils.sysconfig import get_python_version
# Set the path to the build directory.
plat_specifier = ".%s-%s" % (get_platform(), get_python_version())
- if sys.version_info[0] >= 3 or sys.version_info[1] >= 6:
- library_dir = "../build/lib%s%s" % (plat_specifier,
- (sys.pydebug and "-pydebug" or ""))
- else:
- library_dir = "../build/lib%s%s" % ((sys.pydebug and "_d" or ""),
- plat_specifier)
+ library_dir = "../build/lib%s%s" % (plat_specifier,
+ (sys.pydebug and "-pydebug" or ""))
return os.path.abspath(library_dir)
diff --git a/tests/test_auth.py b/tests/test_auth.py
index a9cfe736..dafbdc31 100644
--- a/tests/test_auth.py
+++ b/tests/test_auth.py
@@ -22,13 +22,6 @@ else:
from SimpleHTTPServer import SimpleHTTPRequestHandler as HTTPRequestHandler
-if sys.version_info[0] == 2 and sys.version_info[1] == 6:
- from unittest2 import TestCase
- TestCase # pyflakes
-else:
- from unittest import TestCase
-
-
import apt_pkg
import apt.auth
@@ -118,7 +111,7 @@ DHcut3Yey8o=
-----END PGP PUBLIC KEY BLOCK-----"""
-class TestAuthKeys(TestCase):
+class TestAuthKeys(unittest.TestCase):
"""Test handling of keys for signed repositories."""
diff --git a/tests/test_size_to_str.py b/tests/test_size_to_str.py
index 1d0e9232..ba1e45b3 100644
--- a/tests/test_size_to_str.py
+++ b/tests/test_size_to_str.py
@@ -2,19 +2,12 @@
__author__ = "Barry Warsaw <barry@ubuntu.com>, James Hunt, Michael Vogt"
-import sys
import unittest
import apt_pkg
-if sys.version_info[0] == 2 and sys.version_info[1] == 6:
- from unittest2 import TestCase
- TestCase # pyflakes
-else:
- from unittest import TestCase
-
-class SizeToStrTestCase(TestCase):
+class SizeToStrTestCase(unittest.TestCase):
"""Test apt_pkg.size_to_str"""
DATA = {