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

Side by Side Diff: Lib/test/test_sysconfig.py

Issue 16510: Using appropriate checks in 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
« no previous file with comments | « Lib/test/test_symtable.py ('k') | Lib/test/test_sys.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import unittest 1 import unittest
2 import sys 2 import sys
3 import os 3 import os
4 import subprocess 4 import subprocess
5 import shutil 5 import shutil
6 from copy import copy 6 from copy import copy
7 7
8 from test.support import (run_unittest, TESTFN, unlink, check_warnings, 8 from test.support import (run_unittest, TESTFN, unlink, check_warnings,
9 captured_stdout, skip_unless_symlink) 9 captured_stdout, skip_unless_symlink)
10 10
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 # before comparing 279 # before comparing
280 global_path = global_path.replace(sys.base_prefix, sys.prefix) 280 global_path = global_path.replace(sys.base_prefix, sys.prefix)
281 base = base.replace(sys.base_prefix, sys.prefix) 281 base = base.replace(sys.base_prefix, sys.prefix)
282 user_path = get_path(name, 'posix_user') 282 user_path = get_path(name, 'posix_user')
283 self.assertEqual(user_path, global_path.replace(base, user, 1)) 283 self.assertEqual(user_path, global_path.replace(base, user, 1))
284 284
285 def test_main(self): 285 def test_main(self):
286 # just making sure _main() runs and returns things in the stdout 286 # just making sure _main() runs and returns things in the stdout
287 with captured_stdout() as output: 287 with captured_stdout() as output:
288 _main() 288 _main()
289 self.assertTrue(len(output.getvalue().split('\n')) > 0) 289 self.assertGreater(len(output.getvalue().split('\n')), 0)
290 290
291 @unittest.skipIf(sys.platform == "win32", "Does not apply to Windows") 291 @unittest.skipIf(sys.platform == "win32", "Does not apply to Windows")
292 def test_ldshared_value(self): 292 def test_ldshared_value(self):
293 ldflags = sysconfig.get_config_var('LDFLAGS') 293 ldflags = sysconfig.get_config_var('LDFLAGS')
294 ldshared = sysconfig.get_config_var('LDSHARED') 294 ldshared = sysconfig.get_config_var('LDSHARED')
295 295
296 self.assertIn(ldflags, ldshared) 296 self.assertIn(ldflags, ldshared)
297 297
298 @unittest.skipUnless(sys.platform == "darwin", "test only relevant on MacOSX ") 298 @unittest.skipUnless(sys.platform == "darwin", "test only relevant on MacOSX ")
299 def test_platform_in_subprocess(self): 299 def test_platform_in_subprocess(self):
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 'var4': '$/invalid', 414 'var4': '$/invalid',
415 'var5': 'dollar$5', 415 'var5': 'dollar$5',
416 }) 416 })
417 417
418 418
419 def test_main(): 419 def test_main():
420 run_unittest(TestSysConfig, MakefileTests) 420 run_unittest(TestSysConfig, MakefileTests)
421 421
422 if __name__ == "__main__": 422 if __name__ == "__main__":
423 test_main() 423 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_symtable.py ('k') | Lib/test/test_sys.py » ('j') | no next file with comments »

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