diff options
Diffstat (limited to 'Lib/distutils/tests/test_dist.py')
| -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 6f5fe9c..bf59c41 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -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): |
