[Python-checkins] distutils2: Use modern unittest methods

tarek.ziade python-checkins at python.org
Sun Sep 19 10:20:23 CEST 2010


tarek.ziade pushed b66f9989fed0 to distutils2:

http://hg.python.org/distutils2/rev/b66f9989fed0
changeset:   650:b66f9989fed0
user:        ?ric Araujo <merwok at netwok.org>
date:        Fri Aug 20 01:05:26 2010 +0200
summary:     Use modern unittest methods
files:       src/distutils2/tests/test_dist.py

diff --git a/src/distutils2/tests/test_dist.py b/src/distutils2/tests/test_dist.py
--- a/src/distutils2/tests/test_dist.py
+++ b/src/distutils2/tests/test_dist.py
@@ -148,8 +148,9 @@
                           'url': 'xxxx',
                           'badoptname': 'xxx'})
 
-        self.assertTrue(len(self.warnings)==1)
-        self.assertTrue("Unknown distribution" in self.warnings[0]['message'].args[0])
+        self.assertEqual(len(self.warnings), 1)
+        self.assertIn("Unknown distribution",
+                      self.warnings[0]['message'].args[0])
 
     def test_empty_options(self):
         # an empty options dictionary should not stay in the
@@ -178,7 +179,7 @@
                           'version': 'xxx',
                           'url': 'xxxx',
                           'options': dict(sdist=dict(owner="root"))})
-        self.assertTrue("owner" in dist.get_option_dict("sdist"))
+        self.assertIn('owner', dist.get_option_dict('sdist'))
 
     def test_finalize_options(self):
 

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


More information about the Python-checkins mailing list