mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Merged revisions 68033 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68033 | tarek.ziade | 2008-12-29 23:23:53 +0100 (Mon, 29 Dec 2008) | 1 line fixed #4646 : distutils was choking on empty options arg in the setup function. ........
This commit is contained in:
parent
3f15ae37af
commit
0edab54cdf
3 changed files with 28 additions and 1 deletions
|
@ -8,6 +8,7 @@ import os
|
|||
import StringIO
|
||||
import sys
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from test.test_support import TESTFN
|
||||
|
||||
|
@ -131,6 +132,29 @@ class DistributionTestCase(unittest.TestCase):
|
|||
if os.path.exists(my_file):
|
||||
os.remove(my_file)
|
||||
|
||||
def test_empty_options(self):
|
||||
# an empty options dictionary should not stay in the
|
||||
# list of attributes
|
||||
klass = distutils.dist.Distribution
|
||||
|
||||
# catching warnings
|
||||
warns = []
|
||||
def _warn(msg):
|
||||
warns.append(msg)
|
||||
|
||||
old_warn = warnings.warn
|
||||
warnings.warn = _warn
|
||||
try:
|
||||
dist = klass(attrs={'author': 'xxx',
|
||||
'name': 'xxx',
|
||||
'version': 'xxx',
|
||||
'url': 'xxxx',
|
||||
'options': {}})
|
||||
finally:
|
||||
warnings.warn = old_warn
|
||||
|
||||
self.assertEquals(len(warns), 0)
|
||||
|
||||
class MetadataTestCase(unittest.TestCase):
|
||||
|
||||
def test_simple_metadata(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue