summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-12-31 23:18:43 +0100
committerMichael Vogt <mvo@debian.org>2014-01-05 20:04:26 +0100
commite3c26754af1891d2c50993730467fc9335ec5f09 (patch)
treea4caaa2974ef7108807a790885c7b560f900a783 /tests
parenteac4d047d8774def55b03cb82d505d237d93ea55 (diff)
downloadpython-apt-e3c26754af1891d2c50993730467fc9335ec5f09.tar.gz
make pyflakes clean
Diffstat (limited to 'tests')
-rw-r--r--tests/test_aptsources.py2
-rw-r--r--tests/test_aptsources_ports.py1
-rw-r--r--tests/test_cache_invocation.py1
-rw-r--r--tests/test_debfile.py11
-rw-r--r--tests/test_debfile_multiarch.py2
-rw-r--r--tests/test_lp659438.py2
-rw-r--r--tests/test_paths.py1
-rw-r--r--tests/test_progress.py2
-rw-r--r--tests/test_utils.py4
9 files changed, 5 insertions, 21 deletions
diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py
index 5a174f3b..0b74cb79 100644
--- a/tests/test_aptsources.py
+++ b/tests/test_aptsources.py
@@ -140,7 +140,6 @@ class TestAptSources(unittest.TestCase):
distro = aptsources.distro.get_distro(id="Ubuntu")
distro.get_sources(sources)
# test if all suits of the current distro were detected correctly
- dist_templates = set()
for s in sources:
if not s.template:
self.fail("source entry '%s' has no matcher" % s)
@@ -178,7 +177,6 @@ class TestAptSources(unittest.TestCase):
assert sources.list[9].line.strip() == str(sources.list[9])
def test_enable_component(self):
- from subprocess import Popen, PIPE
target = "./data/aptsources/sources.list.enable_comps"
line = "deb http://archive.ubuntu.com/ubuntu lucid main\n"
with open(target, "w") as target_file:
diff --git a/tests/test_aptsources_ports.py b/tests/test_aptsources_ports.py
index 67c21b9c..b625b8c4 100644
--- a/tests/test_aptsources_ports.py
+++ b/tests/test_aptsources_ports.py
@@ -31,7 +31,6 @@ class TestAptSourcesPorts(unittest.TestCase):
"8.04")
distro.get_sources(sources)
# test if all suits of the current distro were detected correctly
- dist_templates = set()
for s in sources:
if not s.line.strip() or s.line.startswith("#"):
continue
diff --git a/tests/test_cache_invocation.py b/tests/test_cache_invocation.py
index a89ef557..4bba0813 100644
--- a/tests/test_cache_invocation.py
+++ b/tests/test_cache_invocation.py
@@ -25,6 +25,7 @@ class TestCache(unittest.TestCase):
"""cache_invocation: Test correct invocation."""
apt_cache = apt_pkg.Cache(progress=None)
apt_depcache = apt_pkg.DepCache(apt_cache)
+ self.assertNotEqual(apt_depcache, None)
if __name__ == "__main__":
unittest.main()
diff --git a/tests/test_debfile.py b/tests/test_debfile.py
index 3e933944..9379884a 100644
--- a/tests/test_debfile.py
+++ b/tests/test_debfile.py
@@ -123,15 +123,8 @@ Description: testpackage for gdebi - contains usr/bin/binary for file reading
deb.missing_deps
def test_no_supported_data_tar(self):
- # ensure that a unknown data.tar.xxx raises a exception
- raised = False
- try:
- deb = apt.debfile.DebPackage("./data/test_debs/data-tar-broken.deb")
- except SystemError:
- raised = True
- # with self.assertRaises(SystemError): is more elegant above, but
- # we need to support python2.6
- self.assertTrue(raised)
+ with self.assertRaises(SystemError):
+ apt.debfile.DebPackage("./data/test_debs/data-tar-broken.deb")
def test_contains(self):
deb = apt.debfile.DebPackage("./data/test_debs/data-tar-xz.deb")
diff --git a/tests/test_debfile_multiarch.py b/tests/test_debfile_multiarch.py
index bbf62016..cf6479b1 100644
--- a/tests/test_debfile_multiarch.py
+++ b/tests/test_debfile_multiarch.py
@@ -7,8 +7,6 @@
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
"""Unit tests for verifying the correctness of DebPackage in apt.debfile."""
-import os
-import logging
import unittest
from test_all import get_library_dir
diff --git a/tests/test_lp659438.py b/tests/test_lp659438.py
index b9a837b4..334f574d 100644
--- a/tests/test_lp659438.py
+++ b/tests/test_lp659438.py
@@ -63,7 +63,7 @@ Architecture: all""")
def tearDown(self):
# this resets the rootdir apt_pkg.config to ensure it does not
# "pollute" the later tests
- cache = apt.cache.Cache(rootdir="/")
+ apt.cache.Cache(rootdir="/")
shutil.rmtree(self.chroot_path)
def test_survive_reqreinst(self):
diff --git a/tests/test_paths.py b/tests/test_paths.py
index 17f562d2..48f86c52 100644
--- a/tests/test_paths.py
+++ b/tests/test_paths.py
@@ -3,7 +3,6 @@
#
import os
import shutil
-import tempfile
import unittest
import apt_inst
diff --git a/tests/test_progress.py b/tests/test_progress.py
index e4a5fa3c..508da7d4 100644
--- a/tests/test_progress.py
+++ b/tests/test_progress.py
@@ -44,7 +44,7 @@ class TestProgress(unittest.TestCase):
def test_acquire_progress(self):
progress = TestAcquireProgress()
cache = apt.Cache()
- res = cache.update(progress)
+ cache.update(progress)
self.assertTrue(progress.pulsed)
if __name__ == "__main__":
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 2676bb98..35c0a466 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -8,12 +8,8 @@
import datetime
import os
-import sys
import unittest
-import apt_pkg
-import apt.utils
-
from apt.utils import (
get_maintenance_end_date,
get_release_date_from_release_file,