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

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

Issue 16510: Using appropriate checks in tests
Patch Set: Created 7 years, 6 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_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 return LocalClass 10 return LocalClass
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 self.assertTrue(cell(-36) == cell(-36.0)) 329 self.assertTrue(cell(-36) == cell(-36.0))
330 self.assertTrue(cell(True) > empty_cell()) 330 self.assertTrue(cell(True) > empty_cell())
331 331
332 332
333 class StaticMethodAttrsTest(unittest.TestCase): 333 class StaticMethodAttrsTest(unittest.TestCase):
334 def test_func_attribute(self): 334 def test_func_attribute(self):
335 def f(): 335 def f():
336 pass 336 pass
337 337
338 c = classmethod(f) 338 c = classmethod(f)
339 self.assertTrue(c.__func__ is f) 339 self.assertIs(c.__func__, f)
340 340
341 s = staticmethod(f) 341 s = staticmethod(f)
342 self.assertTrue(s.__func__ is f) 342 self.assertIs(s.__func__, f)
343 343
344 344
345 class BuiltinFunctionPropertiesTest(unittest.TestCase): 345 class BuiltinFunctionPropertiesTest(unittest.TestCase):
346 # XXX Not sure where this should really go since I can't find a 346 # XXX Not sure where this should really go since I can't find a
347 # test module specifically for builtin_function_or_method. 347 # test module specifically for builtin_function_or_method.
348 348
349 def test_builtin__qualname__(self): 349 def test_builtin__qualname__(self):
350 import time 350 import time
351 351
352 # builtin function: 352 # builtin function:
(...skipping 16 matching lines...) Expand all
369 369
370 def test_main(): 370 def test_main():
371 support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest, 371 support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest,
372 ArbitraryFunctionAttrTest, FunctionDictsTest, 372 ArbitraryFunctionAttrTest, FunctionDictsTest,
373 FunctionDocstringTest, CellTest, 373 FunctionDocstringTest, CellTest,
374 StaticMethodAttrsTest, 374 StaticMethodAttrsTest,
375 BuiltinFunctionPropertiesTest) 375 BuiltinFunctionPropertiesTest)
376 376
377 if __name__ == "__main__": 377 if __name__ == "__main__":
378 test_main() 378 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+