diff options
| author | R. David Murray <rdmurray@bitdance.com> | 2010-02-24 01:46:21 +0000 |
|---|---|---|
| committer | R. David Murray <rdmurray@bitdance.com> | 2010-02-24 01:46:21 +0000 |
| commit | 0d43be6127018ead86b1a3f2d20a9f97a85c92f3 (patch) | |
| tree | 248c757e6cdac1560ebcc99eb26e45257f09de1a /tests/test_extension.py | |
| parent | 8943dd0fe879512f88742a42893da24553cca38b (diff) | |
| download | python-setuptools-git-0d43be6127018ead86b1a3f2d20a9f97a85c92f3.tar.gz | |
Merged revisions 78351 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78351 | r.david.murray | 2010-02-22 19:24:49 -0500 (Mon, 22 Feb 2010) | 5 lines
Issue 6292: for the moment at least, the test suite passes if run
with -OO. Tests requiring docstrings are skipped. Patch by
Brian Curtin, thanks to Matias Torchinsky for helping review and
improve the patch.
........
Diffstat (limited to 'tests/test_extension.py')
| -rwxr-xr-x | tests/test_extension.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/test_extension.py b/tests/test_extension.py index 9d3cfe6f..857284dd 100755 --- a/tests/test_extension.py +++ b/tests/test_extension.py @@ -1,6 +1,7 @@ """Tests for distutils.extension.""" -import unittest import os +import sys +import unittest import warnings from test.support import check_warnings @@ -32,16 +33,22 @@ class ExtensionTestCase(unittest.TestCase): self.assertEquals(names, wanted) - def test_extension_init(self): - # the first argument, which is the name, must be a string + @unittest.skipIf(sys.flags.optimize >= 2, + "Assertions are omitted with -O2 and above") + def test_extension_init_assertions(self): + # The first argument, which is the name, must be a string. self.assertRaises(AssertionError, Extension, 1, []) - ext = Extension('name', []) - self.assertEquals(ext.name, 'name') # the second argument, which is the list of files, must # be a list of strings self.assertRaises(AssertionError, Extension, 'name', 'file') self.assertRaises(AssertionError, Extension, 'name', ['file', 1]) + + def test_extension_init(self): + ext = Extension('name', []) + self.assertEquals(ext.name, 'name') + + ext = Extension('name', ['file1', 'file2']) self.assertEquals(ext.sources, ['file1', 'file2']) |
