Issue 20554: Use specific asserts in optparse test
Created on 2014-02-07 21:34 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_optparse_asserts.patch | serhiy.storchaka, 2014-02-07 21:34 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 786 | closed | serhiy.storchaka, 2017-03-23 17:05 | |
| Messages (4) | |||
|---|---|---|---|
| msg210560 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2014-02-07 21:34 | |
The proposed patch makes argparse and optparse modules tests use more specific asserts. This will provide more useful failure report. |
|||
| msg221998 - (view) | Author: Berker Peksag (berker.peksag) * ![]() |
Date: 2014-07-01 00:08 | |
diff -r 3b94a4ef244e Lib/test/test_argparse.py --- a/Lib/test/test_argparse.py Fri Feb 07 17:53:13 2014 +0100 +++ b/Lib/test/test_argparse.py Fri Feb 07 22:34:13 2014 +0200 @@ -4219,7 +4219,7 @@ e = sys.exc_info()[1] expected = 'unknown action' msg = 'expected %r, found %r' % (expected, e) - self.assertTrue(expected in str(e), msg) + self.assertIn(expected, str(e), msg) The patch in issue 9554 replaces this code with assertRaises and assertRegex (I will change the code to use assertRaisesRegex). |
|||
| msg222380 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014-07-05 23:52 | |
I don't object to these changes but I don't see much sense in them as optparse has been deprecated since 2.7/3.2. |
|||
| msg264969 - (view) | Author: Berker Peksag (berker.peksag) * ![]() |
Date: 2016-05-06 12:10 | |
The patch looks simple, but I don't see much gain to apply it since optparse is a deprecated module. I'm in favor of closing this as 'wont fix'. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:58 | admin | set | github: 64753 |
| 2017-03-23 18:35:37 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2017-03-23 17:05:29 | serhiy.storchaka | set | pull_requests: + pull_request691 |
| 2016-05-06 12:16:44 | serhiy.storchaka | set | status: open -> closed resolution: wont fix stage: patch review -> resolved |
| 2016-05-06 12:10:07 | berker.peksag | set | priority: normal -> low messages: + msg264969 |
| 2014-07-05 23:52:50 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg222380 |
| 2014-07-01 01:38:37 | paul.j3 | set | nosy:
+ paul.j3 |
| 2014-07-01 00:08:11 | berker.peksag | set | nosy:
+ berker.peksag title: Use specific asserts in argparse and optparse tests -> Use specific asserts in optparse test messages: + msg221998 stage: patch review |
| 2014-02-07 21:36:36 | serhiy.storchaka | link | issue16510 dependencies |
| 2014-02-07 21:34:19 | serhiy.storchaka | create | |
