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

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

Issue 16510: Using appropriate checks in tests
Patch Set: Created 6 years 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_ftplib.py ('k') | Lib/test/test_functools.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 from test import support 1 from test import support
2 import types 2 import types
3 import unittest 3 import unittest
4 4
5 5
6 def global_function(): 6 def global_function():
7 def inner_function(): 7 def inner_function():
8 class LocalClass: 8 class LocalClass:
9 pass 9 pass
10 global inner_global_function 10 global inner_global_function
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 self.assertTrue(cell(-36) == cell(-36.0)) 336 self.assertTrue(cell(-36) == cell(-36.0))
337 self.assertTrue(cell(True) > empty_cell()) 337 self.assertTrue(cell(True) > empty_cell())
338 338
339 339
340 class StaticMethodAttrsTest(unittest.TestCase): 340 class StaticMethodAttrsTest(unittest.TestCase):
341 def test_func_attribute(self): 341 def test_func_attribute(self):
342 def f(): 342 def f():
343 pass 343 pass
344 344
345 c = classmethod(f) 345 c = classmethod(f)
346 self.assertTrue(c.__func__ is f) 346 self.assertIs(c.__func__, f)
347 347
348 s = staticmethod(f) 348 s = staticmethod(f)
349 self.assertTrue(s.__func__ is f) 349 self.assertIs(s.__func__, f)
350 350
351 351
352 class BuiltinFunctionPropertiesTest(unittest.TestCase): 352 class BuiltinFunctionPropertiesTest(unittest.TestCase):
353 # XXX Not sure where this should really go since I can't find a 353 # XXX Not sure where this should really go since I can't find a
354 # test module specifically for builtin_function_or_method. 354 # test module specifically for builtin_function_or_method.
355 355
356 def test_builtin__qualname__(self): 356 def test_builtin__qualname__(self):
357 import time 357 import time
358 358
359 # builtin function: 359 # builtin function:
(...skipping 16 matching lines...) Expand all
376 376
377 def test_main(): 377 def test_main():
378 support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest, 378 support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest,
379 ArbitraryFunctionAttrTest, FunctionDictsTest, 379 ArbitraryFunctionAttrTest, FunctionDictsTest,
380 FunctionDocstringTest, CellTest, 380 FunctionDocstringTest, CellTest,
381 StaticMethodAttrsTest, 381 StaticMethodAttrsTest,
382 BuiltinFunctionPropertiesTest) 382 BuiltinFunctionPropertiesTest)
383 383
384 if __name__ == "__main__": 384 if __name__ == "__main__":
385 test_main() 385 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_ftplib.py ('k') | Lib/test/test_functools.py » ('j') | no next file with comments »

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