[Python-checkins] distutils2: Improved test coverage

tarek.ziade python-checkins at python.org
Sat Jul 24 23:45:28 CEST 2010


tarek.ziade pushed fdc0f44dc5ec to distutils2:

http://hg.python.org/distutils2/rev/fdc0f44dc5ec
changeset:   375:fdc0f44dc5ec
user:        Luis Rojas <luis.r.rojas at gmail.com>
date:        Thu Jul 15 21:30:43 2010 -0400
summary:     Improved test coverage
files:       src/distutils2/tests/test_util.py

diff --git a/src/distutils2/tests/test_util.py b/src/distutils2/tests/test_util.py
--- a/src/distutils2/tests/test_util.py
+++ b/src/distutils2/tests/test_util.py
@@ -4,6 +4,8 @@
 from copy import copy
 from StringIO import StringIO
 import subprocess
+import tempfile
+import time
 
 from distutils2.errors import (DistutilsPlatformError,
                                DistutilsByteCompileError,
@@ -257,7 +259,10 @@
 
     def test_newer(self):
         self.assertRaises(DistutilsFileError, util.newer, 'xxx', 'xxx')
-
+        self.newer_f1 = tempfile.NamedTemporaryFile()
+        time.sleep(1)
+        self.newer_f2 = tempfile.NamedTemporaryFile()
+        self.assertTrue(util.newer(self.newer_f2.name, self.newer_f1.name))
 
     def test_find_packages(self):
         # let's create a structure we want to scan:

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list