Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Add test cases for single-line test case docstring. | 4b78af6d79c868fd9658258a122fc2ef28876c35 | Ben Finney | 2017-05-01 06:41:43 |
Comment as to why docs are built against Python 3.6 (#1550) | 31b3901a078774b28a88dc410376c46e28c52c9c | Brett Cannon | 2017-05-11 17:45:34 |
bpo-30308: Code coverage for argument in random.shuffle (#1504) | f111fd2e65ef7aefd4ebeadbb48e84d609bf3733 | csabella | 2017-05-11 15:19:35 |
bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097) | 991adca012f5e106c2d4040ce619c696ba6f9c46 | INADA Naoki | 2017-05-11 12:18:38 |
#30190: fix invalid escape sequence warnings (#1534) | c4750959acbfc3057f12aaec832483ba30898d1c | Giampaolo Rodola | 2017-05-10 18:13:20 |
bpo-28787: Fix out of tree --with-dtrace builds (#135) | f6eae5bf1c5d7b83e5d5bdbecfff928e478c1cfd | stratakis | 2017-05-10 15:08:15 |
bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) | 2ddf5a19c3a06978edff2c8ba0aaf5df3528204a | Xiang Zhang | 2017-05-10 10:19:41 |
bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. (#1490) | 305ccbe27ea5ba82fd2d8c32ec739f980e524330 | Serhiy Storchaka | 2017-05-10 03:05:20 |
bpo-30320: test_eintr now uses pthread_sigmask() (#1523) | 211a392cc15f9a7b1b8ce65d8f6c9f8237d1b77f | Victor Stinner | 2017-05-10 00:37:42 |
PCbuild/build.bat: pass command line parameters when building PGO (#1510) | 291557e2904fa149ee3d56142f41acf63c47fea3 | Charles | 2017-05-09 21:58:48 |
bpo-30285: Optimize case-insensitive matching and searching (#1482) | 6d336a027913327fc042b0d758a16724fea27b9c | Serhiy Storchaka | 2017-05-09 20:37:14 |
bpo-30024: Circular imports involving absolute imports with binding (#1264) | f93234bb8a87855f295d441524e519481ce6ab13 | Serhiy Storchaka | 2017-05-09 19:31:05 |
bpo-30273: update distutils.sysconfig for venv's created from Python (#1515) | dbdea629e2e0e4bd8845aa55041e0a0ca4172cf3 | Jeremy Kloth | 2017-05-09 15:24:13 |
bpo-30258: regrtest: Fix run_tests_multiprocess() (#1479) | 74683fc6247c522ae955a6e7308b8ff51def35d8 | Victor Stinner | 2017-05-09 09:34:01 |
bpo-29990: Fix range checking in GB18030 decoder (#1495) | 9da408d15bdef624a5632182cb4edf98001fa82f | Xiang Zhang | 2017-05-09 03:38:32 |
bpo-30289: remove Misc/python-config.sh when make distclean (#1498) | fa5abac1e6cd74979557d5a6f960a55f40a10b0e | Xiang Zhang | 2017-05-09 02:32:13 |
bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991) | cc3fa204d357be5fafc10eb8c2a80fe0bca998f1 | Pierre Quentel | 2017-05-08 12:08:34 |
Fix a trivial typo in global section (#1497) | f34c6850203a2406c4950af7a9c8a134145df4ea | Jim Fasarakis-Hilliard | 2017-05-08 11:36:29 |
Closes bpo-30168: indent methods in Logger Class (#1295) | 55ace65eba587fe3cf3759a43cccf85214651971 | Jim Fasarakis-Hilliard | 2017-05-07 18:40:18 |
Revert bpo-26293 for zipfile breakage. See also bpo-29094. (#1484) | 3763ea865cee5bbabcce11cd577811135e0fc747 | Serhiy Storchaka | 2017-05-06 11:46:01 |
File | Lines added | Lines deleted |
---|---|---|
Lib/unittest/test/test_functiontestcase.py | 12 | 8 |
File Lib/unittest/test/test_functiontestcase.py changed (mode: 100644) (index c5f2bcbe74..3dfe017cad) | |||
... | ... | class Test_FunctionTestCase(unittest.TestCase): | |
126 | 126 | ||
127 | 127 | self.assertIsInstance(test.id(), str) | self.assertIsInstance(test.id(), str) |
128 | 128 | ||
129 | # "Returns a one-line description of the test, or None if no description | ||
130 | # has been provided. The default implementation of this method returns | ||
131 | # the first line of the test method's docstring, if available, or None." | ||
132 | def test_shortDescription__no_docstring(self): | ||
129 | def test_shortDescription__no_description_no_docstring(self): | ||
130 | """ Should return None by default for shortDescription. """ | ||
133 | 131 | test = unittest.FunctionTestCase(lambda: None) | test = unittest.FunctionTestCase(lambda: None) |
134 | 132 | ||
135 | 133 | self.assertEqual(test.shortDescription(), None) | self.assertEqual(test.shortDescription(), None) |
136 | 134 | ||
137 | # "Returns a one-line description of the test, or None if no description | ||
138 | # has been provided. The default implementation of this method returns | ||
139 | # the first line of the test method's docstring, if available, or None." | ||
140 | def test_shortDescription__singleline_docstring(self): | ||
135 | def test_shortDescription__singleline_description(self): | ||
136 | """ Should use the specified description for shortDescription. """ | ||
141 | 137 | desc = "this tests foo" | desc = "this tests foo" |
142 | 138 | test = unittest.FunctionTestCase(lambda: None, description=desc) | test = unittest.FunctionTestCase(lambda: None, description=desc) |
143 | 139 | ||
144 | 140 | self.assertEqual(test.shortDescription(), "this tests foo") | self.assertEqual(test.shortDescription(), "this tests foo") |
145 | 141 | ||
142 | def test_shortDescription__no_description_singleline_docstring(self): | ||
143 | """ Should use the function docstring for the shortDescription. """ | ||
144 | test_function = (lambda: None) | ||
145 | test_function.__doc__ = """Should use the function docstring.""" | ||
146 | test = unittest.FunctionTestCase(test_function) | ||
147 | expected_description = "Should use the function docstring." | ||
148 | self.assertEqual(test.shortDescription(), expected_description) | ||
149 | |||
146 | 150 | ||
147 | 151 | if __name__ == "__main__": | if __name__ == "__main__": |
148 | 152 | unittest.main() | unittest.main() |