summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@canonical.com>2012-11-19 14:16:39 +0000
committerColin Watson <cjwatson@canonical.com>2012-11-19 14:16:39 +0000
commit178bf6c4cbde8a3f66a1b8f018d7a950125eee84 (patch)
tree962ac9a3002ca780ed6ab35ba6b4cc49a7f5bc1d
parentb8ea5404dd387aa9f414a44113610d395777b778 (diff)
downloadpython-apt-178bf6c4cbde8a3f66a1b8f018d7a950125eee84.tar.gz
* tests/test_aptsources.py:
- Clean up file object in test_enable_component.
-rw-r--r--debian/changelog2
-rw-r--r--tests/test_aptsources.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 2fbfc3b4..02e99916 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ python-apt (0.8.8ubuntu4) UNRELEASED; urgency=low
causes autopkgtest to fail.
* tests/test_all.py:
- Write general test status output to stdout, not stderr.
+ * tests/test_aptsources.py:
+ - Clean up file object in test_enable_component.
-- Colin Watson <cjwatson@ubuntu.com> Mon, 19 Nov 2012 11:57:28 +0000
diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py
index 41cfabb3..75dd91c1 100644
--- a/tests/test_aptsources.py
+++ b/tests/test_aptsources.py
@@ -164,7 +164,8 @@ class TestAptSources(unittest.TestCase):
from subprocess import Popen, PIPE
target = "./data/aptsources/sources.list.enable_comps"
line = "deb http://archive.ubuntu.com/ubuntu lucid main\n"
- open(target, "w").write(line)
+ with open(target, "w") as target_file:
+ target_file.write(line)
apt_pkg.config.set("Dir::Etc::sourcelist", target)
sources = aptsources.sourceslist.SourcesList(True, self.templates)
distro = aptsources.distro.get_distro(id="Ubuntu")