Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(41963)

Side by Side Diff: Lib/distutils/tests/test_sysconfig.py

Issue 19600: Use specific asserts in distutils tests
Patch Set: Created 5 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 """Tests for distutils.sysconfig.""" 1 """Tests for distutils.sysconfig."""
2 import os 2 import os
3 import shutil 3 import shutil
4 import test 4 import test
5 import unittest 5 import unittest
6 6
7 from distutils import sysconfig 7 from distutils import sysconfig
8 from distutils.ccompiler import get_default_compiler 8 from distutils.ccompiler import get_default_compiler
9 from distutils.tests import support 9 from distutils.tests import support
10 from test.support import TESTFN, run_unittest 10 from test.support import TESTFN, run_unittest
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 inc_dir = sysconfig.get_python_inc() 43 inc_dir = sysconfig.get_python_inc()
44 # This is not much of a test. We make sure Python.h exists 44 # This is not much of a test. We make sure Python.h exists
45 # in the directory returned by get_python_inc() but we don't know 45 # in the directory returned by get_python_inc() but we don't know
46 # it is the correct file. 46 # it is the correct file.
47 self.assertTrue(os.path.isdir(inc_dir), inc_dir) 47 self.assertTrue(os.path.isdir(inc_dir), inc_dir)
48 python_h = os.path.join(inc_dir, "Python.h") 48 python_h = os.path.join(inc_dir, "Python.h")
49 self.assertTrue(os.path.isfile(python_h), python_h) 49 self.assertTrue(os.path.isfile(python_h), python_h)
50 50
51 def test_get_config_vars(self): 51 def test_get_config_vars(self):
52 cvars = sysconfig.get_config_vars() 52 cvars = sysconfig.get_config_vars()
53 self.assertTrue(isinstance(cvars, dict)) 53 self.assertIsInstance(cvars, dict)
54 self.assertTrue(cvars) 54 self.assertTrue(cvars)
55 55
56 def test_srcdir(self): 56 def test_srcdir(self):
57 # See Issues #15322, #15364. 57 # See Issues #15322, #15364.
58 srcdir = sysconfig.get_config_var('srcdir') 58 srcdir = sysconfig.get_config_var('srcdir')
59 59
60 self.assertTrue(os.path.isabs(srcdir), srcdir) 60 self.assertTrue(os.path.isabs(srcdir), srcdir)
61 self.assertTrue(os.path.isdir(srcdir), srcdir) 61 self.assertTrue(os.path.isdir(srcdir), srcdir)
62 62
63 if sysconfig.python_build: 63 if sysconfig.python_build:
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 158
159 def test_suite(): 159 def test_suite():
160 suite = unittest.TestSuite() 160 suite = unittest.TestSuite()
161 suite.addTest(unittest.makeSuite(SysconfigTestCase)) 161 suite.addTest(unittest.makeSuite(SysconfigTestCase))
162 return suite 162 return suite
163 163
164 164
165 if __name__ == '__main__': 165 if __name__ == '__main__':
166 run_unittest(test_suite()) 166 run_unittest(test_suite())
OLDNEW

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+