diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2008-12-29 22:38:38 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2008-12-29 22:38:38 (GMT) |
commit | 4450dcf041523fa6752be97994a4111a803dd1fc (patch) | |
tree | 06b0c40c8f7c7df3fd77206299b3ce48e09b7fad /Lib/distutils/tests | |
parent | 0fa3f3d663ae4c8d79abc20681d072a1015cd2f7 (diff) | |
download | cpython-4450dcf041523fa6752be97994a4111a803dd1fc.zip cpython-4450dcf041523fa6752be97994a4111a803dd1fc.tar.gz cpython-4450dcf041523fa6752be97994a4111a803dd1fc.tar.bz2 |
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.
........
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r-- | Lib/distutils/tests/test_dist.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py index f1b11c1..8e7ef5d 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -6,6 +6,7 @@ import os import io import sys import unittest +import warnings from test.support import TESTFN @@ -96,6 +97,29 @@ class DistributionTestCase(unittest.TestCase): os.unlink(TESTFN) + 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): |