[Python-checkins] distutils2: Remove unused names

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


tarek.ziade pushed 7da3f731071a to distutils2:

http://hg.python.org/distutils2/rev/7da3f731071a
changeset:   651:7da3f731071a
user:        ?ric Araujo <merwok at netwok.org>
date:        Fri Aug 20 01:06:19 2010 +0200
summary:     Remove unused names
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
@@ -140,13 +140,11 @@
         dist.metadata.write_file(open(my_file, 'w'))
 
     def test_bad_attr(self):
-        cls = Distribution
-
-        dist = cls(attrs={'author': 'xxx',
-                          'name': 'xxx',
-                          'version': 'xxx',
-                          'url': 'xxxx',
-                          'badoptname': 'xxx'})
+        Distribution(attrs={'author': 'xxx',
+                            'name': 'xxx',
+                            'version': 'xxx',
+                            'url': 'xxxx',
+                            'badoptname': 'xxx'})
 
         self.assertEqual(len(self.warnings), 1)
         self.assertIn("Unknown distribution",
@@ -155,13 +153,11 @@
     def test_empty_options(self):
         # an empty options dictionary should not stay in the
         # list of attributes
-        cls = Distribution
-
-        dist = cls(attrs={'author': 'xxx',
-                          'name': 'xxx',
-                          'version': 'xxx',
-                          'url': 'xxxx',
-                          'options': {}})
+        Distribution(attrs={'author': 'xxx',
+                            'name': 'xxx',
+                            'version': 'xxx',
+                            'url': 'xxxx',
+                            'options': {}})
 
         self.assertEqual(len(self.warnings), 0)
 
@@ -173,12 +169,12 @@
         # Here is an example of how it's used out there:
         # http://svn.pythonmac.org/py2app/py2app/trunk/doc/
         # index.html#specifying-customizations
-        cls = Distribution
-        dist = cls(attrs={'author': 'xxx',
-                          'name': 'xxx',
-                          'version': 'xxx',
-                          'url': 'xxxx',
-                          'options': dict(sdist=dict(owner="root"))})
+        dist = Distribution(attrs={'author': 'xxx',
+                                   'name': 'xxx',
+                                   'version': 'xxx',
+                                   'url': 'xxxx',
+                                   'options': {'sdist': {'owner': 'root'}}})
+
         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