~ubuntu-branches/ubuntu/karmic/python3.0/karmic

« back to all changes in this revision

Viewing changes to Lib/distutils/tests/test_dist.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-16 17:18:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090216171823-1d5cm5qnnjvmnzzm
Tags: 3.0.1-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import io
7
7
import sys
8
8
import unittest
 
9
import warnings
9
10
 
10
11
from test.support import TESTFN
11
12
 
96
97
            os.unlink(TESTFN)
97
98
 
98
99
 
 
100
    def test_empty_options(self):
 
101
        # an empty options dictionary should not stay in the
 
102
        # list of attributes
 
103
        klass = distutils.dist.Distribution
 
104
 
 
105
        # catching warnings
 
106
        warns = []
 
107
        def _warn(msg):
 
108
            warns.append(msg)
 
109
 
 
110
        old_warn = warnings.warn
 
111
        warnings.warn = _warn
 
112
        try:
 
113
            dist = klass(attrs={'author': 'xxx',
 
114
                                'name': 'xxx',
 
115
                                'version': 'xxx',
 
116
                                'url': 'xxxx',
 
117
                                'options': {}})
 
118
        finally:
 
119
            warnings.warn = old_warn
 
120
 
 
121
        self.assertEquals(len(warns), 0)
 
122
 
99
123
class MetadataTestCase(unittest.TestCase):
100
124
 
101
125
    def test_simple_metadata(self):