diff --git a/.travis.yml b/.travis.yml index 4fc9108..359b78d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "2.4" - "2.5" - "2.6" - "2.7" diff --git a/tests/test.py b/tests/test.py index a37ed35..ee881f2 100644 --- a/tests/test.py +++ b/tests/test.py @@ -23,12 +23,14 @@ class CounterTest(unittest.TestCase): self.assertTrue(os.path.isfile(self.logfile)) def test_counter_logfile_length(self): - with open(self.logfile, "r") as log: - self.assertEqual(len(log.readlines()), 7) + log = open(self.logfile, "r") + self.assertEqual(len(log.readlines()), 7) + log.close() def test_counter_logfile_last_line(self): - with open(self.logfile, "r") as log: - self.assertEqual(log.readlines()[6].split()[4], "4") + log = open(self.logfile, "r") + self.assertEqual(log.readlines()[6].split()[4], "4") + log.close() class DaemonizeTest(unittest.TestCase): @@ -51,8 +53,9 @@ class DaemonizeTest(unittest.TestCase): % self.pidfile, shell=True, stdout=subprocess.PIPE) ps_pid = proc.communicate()[0] - with open(self.pidfile, "r") as pid: - pid = pid.read() + pidfile = open(self.pidfile, "r") + pid = pidfile.read() + pidfile.close() self.assertEqual("%s\n" % pid, ps_pid) def test_pidfile_presense(self):