From 07be936471d1459a64a755dc90a53121a8ca41e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Thu, 22 Jul 2010 12:50:05 +0000 Subject: reverted distutils its 3.1 state. All new work is now happening in disutils2, and distutils is now feature-frozen. --- tests/test_extension.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'tests/test_extension.py') diff --git a/tests/test_extension.py b/tests/test_extension.py index 857284dd..1ee30585 100755 --- a/tests/test_extension.py +++ b/tests/test_extension.py @@ -1,16 +1,13 @@ """Tests for distutils.extension.""" -import os -import sys import unittest +import os import warnings from test.support import check_warnings from distutils.extension import read_setup_file, Extension -from distutils.tests.support import capture_warnings class ExtensionTestCase(unittest.TestCase): - @capture_warnings def test_read_setup_file(self): # trying to read a Setup file # (sample extracted from the PyGame project) @@ -33,22 +30,16 @@ class ExtensionTestCase(unittest.TestCase): self.assertEquals(names, wanted) - @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. + def test_extension_init(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']) -- cgit v1.2.1