This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年11月19日 10:44 by serhiy.storchaka, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| tests_asserts.patch | serhiy.storchaka, 2012年11月19日 10:43 | review | ||
| tests_asserts_2.patch | serhiy.storchaka, 2013年08月29日 13:47 | review | ||
| tests_asserts_3.patch | serhiy.storchaka, 2013年11月16日 16:03 | review | ||
| tests_asserts_4.patch | serhiy.storchaka, 2014年02月07日 21:42 | review | ||
| tests_asserts_7.patch | serhiy.storchaka, 2017年04月05日 05:44 | |||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 792 | closed | serhiy.storchaka, 2017年03月23日 17:33 | |
| Messages (12) | |||
|---|---|---|---|
| msg175953 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2012年11月19日 10:43 | |
The proposed patch upgrades tests to use specialized checks added in 3.1 and 3.2 (assertIsNone(x) instead assertTrue(x is None), assertLess(a, b) instead assertTrue(a < b), etc). This modern checks provide a more useful error message in case of a fail. Replaced only those checks that are not related to the tested operators. For example, assertTrue(a < b) preserved if the operator "<" is tested. |
|||
| msg175956 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年11月19日 11:54 | |
Thanks for the work, but we don't generally make bulk changes like this. It generates churn in the codebase, and has the risk of inadvertently changing the meaning of the tests, to little actual benefit. Instead we modernize tests when we touch them for other reasons and are in a position to confirm that the changes do not change the meaning of the tests. (I realize that for most of your changes the meaning is trivially preserved...but when you make a lot of changes you are almost certain to make some mistakes...thus the resistance to doing bulk updates.) |
|||
| msg175960 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2012年11月19日 13:58 | |
I understand this. I checked the patch few times, with long (more than a month) intervals between inspections. If someone wants to modernize some tests, he can turn to this patch for reference. |
|||
| msg186713 - (view) | Author: Tshepang Lekhonkhobe (tshepang) * | Date: 2013年04月13日 12:42 | |
@David is that policy documented in the devguide? If not, should it be? |
|||
| msg186743 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2013年04月13日 16:11 | |
If it isn't documented it should be, and you could open an issue for it. |
|||
| msg196459 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2013年08月29日 13:47 | |
Patch updated to sync with tip. It is 5% less than first version because some changes already applied in other commits. |
|||
| msg202909 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2013年11月14日 22:38 | |
I think there are two counterargument to leaving things alone. 1. The reason for the specialized checks is to change behavior when the test fails, to give more informative error messages. So the change is not purely cosmetic or stylistic. I believe there was a recent case where assertTrue(a == b), a and b strings, had to be changed to assertEqual(a, b) to find out why the assert failed. As I remember, nothing else in the test file obviously needed changing and it would not have been touched otherwise. 2. People adding tests may not review existing tests for modernization. That said, it *is* possible to ignore 2. and not worry about 1. until a test fails. And I agree that the original patch is too much to review. |
|||
| msg203053 - (view) | Author: Jason R. Coombs (jaraco) * (Python committer) | Date: 2013年11月16日 15:44 | |
A third counterargument is: 3. Newer developers (and even seasoned ones) adding new tests may use existing tests as a model for best practices. If the existing tests model sub-optimal practices, then those practices will be perpetuated both in the codebase and in the minds of contributors. Given that Serhiy has so diligently prepared and updated the patch, I'm inclined to say the codebase would be better off accepting the patch. David, can you imagine a process by which a patch like this could be acceptable? |
|||
| msg203057 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2013年11月16日 16:03 | |
Here is synchronized to tip the patch which doesn't include patches for already separated children issues. It touches 129 files and modifies over 600 lines. |
|||
| msg203070 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2013年11月16日 18:15 | |
Jason: yes, if it is broken down into small enough pieces for the module maintainer to be comfortable with the review :). I approved Serhiy's separate patch for test_email. I still wasn't sure about backporting, but I really don't like the 'unless' construct in test_email, so I decided to say OK. |
|||
| msg210566 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2014年02月07日 21:42 | |
After chipping off yet some small separate issues, there are only 276 changed lines left in 80 files. |
|||
| msg221904 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年06月29日 21:35 | |
Can we follow up on this please as it's referenced from #9554 as well. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:38 | admin | set | github: 60714 |
| 2018年03月29日 20:29:02 | serhiy.storchaka | link | issue33183 superseder |
| 2017年04月05日 05:44:23 | serhiy.storchaka | set | status: open -> closed files: + tests_asserts_7.patch resolution: rejected stage: patch review -> resolved |
| 2017年03月23日 18:37:04 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2017年03月23日 17:33:46 | serhiy.storchaka | set | pull_requests: + pull_request697 |
| 2014年06月29日 21:35:49 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg221904 |
| 2014年02月07日 21:42:55 | serhiy.storchaka | set | files:
+ tests_asserts_4.patch messages: + msg210566 |
| 2014年02月07日 21:36:36 | serhiy.storchaka | set | dependencies: + Use specific asserts in optparse test, Use specific asserts in urllib related tests, Use specific asserts in threading tests, Use specific asserts in io tests |
| 2014年02月07日 20:30:27 | serhiy.storchaka | set | dependencies: + Use specific asserts in collections tests, Use specific asserts in decimal tests, Use specific asserts in bytes tests, Use specific asserts in ipaddress tests |
| 2014年02月07日 20:29:32 | serhiy.storchaka | set | dependencies: + Use specific asserts in operator tests, Use specific asserts in unicode tests, Use specific asserts in int tests, Use specific asserts in bigmem tests, Use specific asserts in warnings and exceptions tests, Use specific asserts in mailbox, smtplib and poplib tests |
| 2013年11月16日 18:15:33 | r.david.murray | set | messages: + msg203070 |
| 2013年11月16日 16:03:24 | serhiy.storchaka | set | files:
+ tests_asserts_3.patch messages: + msg203057 |
| 2013年11月16日 15:44:18 | jaraco | set | nosy:
+ jaraco messages: + msg203053 |
| 2013年11月15日 09:57:58 | serhiy.storchaka | set | dependencies: + Use specific asserts in array tests, Use specific asserts in datetime tests, Use specific asserts in http.cookiejar tests, Use specific asserts in weakref tests |
| 2013年11月15日 08:14:58 | serhiy.storchaka | set | dependencies: + Use specific asserts in distutils tests, Use specific asserts in sqlite3 tests, Use specific asserts in tkinter tests, Use specific asserts in test_decr |
| 2013年11月14日 22:38:59 | terry.reedy | set | messages: + msg202909 |
| 2013年11月14日 21:02:18 | serhiy.storchaka | set | dependencies: + Use specific asserts in ctype tests, Use specific asserts in lib2to3 tests, Use specific asserts in importlib tests, Use specific asserts in unittest tests |
| 2013年11月14日 20:46:27 | serhiy.storchaka | set | dependencies: + Use specific asserts in test_email |
| 2013年11月14日 20:41:40 | serhiy.storchaka | set | dependencies: + Use specific asserts in test_asyncio |
| 2013年08月29日 13:47:48 | serhiy.storchaka | set | files:
+ tests_asserts_2.patch messages: + msg196459 |
| 2013年04月13日 16:11:55 | r.david.murray | set | messages: + msg186743 |
| 2013年04月13日 12:42:05 | tshepang | set | messages: + msg186713 |
| 2013年04月13日 12:39:26 | tshepang | set | nosy:
+ tshepang |
| 2012年11月23日 20:13:02 | terry.reedy | set | nosy:
+ terry.reedy |
| 2012年11月22日 01:54:58 | jcea | set | nosy:
+ jcea |
| 2012年11月19日 13:58:54 | serhiy.storchaka | set | messages: + msg175960 |
| 2012年11月19日 11:54:13 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg175956 |
| 2012年11月19日 10:44:18 | serhiy.storchaka | create | |