You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current imaplib implementation lacks quite a few of tests and the ones present are written in different styles. I'd like to propose rewriting the test case with this new style I've developed during PyCon sprints along with David. Once we'll have the entire test suite in place it'll be safer to introduce any changes I'd like to cover, including updating the implementation to newest RFC 3501 version.
I'm reopening this issue per discussion with David we've had on IRC. The scope of this issue to refactor current tests to make them more readable and clean. The most important work is:
having single _setup method
the _setup method should addClenup to clean the environment
have stubs with implemented mostly used methods, all others should be implemented ad-hoc in test methods
use unittest.main() for running tests
We'll do it along current tests to show the improvement. Once we reach satisfactory level we will remove the old tests. This issue is to show this progress.
David can you please take a look once more, I've applied all the changes you've asked for. I'm currently working on adding the existing tests rewritten to use the new framework so it's easy to compare. It's still in progress but the general idea should maintain.
David I think I've re-implemented, using the new style, all the methods from ThreadedNetworkedTests and ThreadedNetworkedTestsSSL, the new classes are NewIMAPTests and NewIMAPSSLTests accordingly.
David I apologize for 2 emails from Reitveld, for some reason it didn't show me all in one view :/ (I need to master Reitveld better). I've just updated patch according to your comments.
Committed. FYI, I did have to make a few tweaks. There were several lines longer than 80 characters still that I wrapped. The tests failed with -W error:BytesWarning, something I normally run the tests with. That required a fix to the library (a decode on the error message...if anyone is depending on the error message being bytes instead of string I'm sorry, but I doubt anyone is. And finally, committing to 3.6 required adding the 'r' prefix to some of the tests regexes to eliminate the invalid escape warnings.
Activity
soltysh commentedon Nov 9, 2015
Our current imaplib implementation lacks quite a few of tests and the ones present are written in different styles. I'd like to propose rewriting the test case with this new style I've developed during PyCon sprints along with David. Once we'll have the entire test suite in place it'll be safer to introduce any changes I'd like to cover, including updating the implementation to newest RFC 3501 version.
soltysh commentedon Dec 7, 2015
I've just found the original issue where I wanted to submit the new tests. I'm closing this in favor of http://bugs.python.org/issue22137.
soltysh commentedon Dec 14, 2015
I'm reopening this issue per discussion with David we've had on IRC. The scope of this issue to refactor current tests to make them more readable and clean. The most important work is:
We'll do it along current tests to show the improvement. Once we reach satisfactory level we will remove the old tests. This issue is to show this progress.
[-]improve test coverage for the imaplib[/-][+]refactor imaplib tests[/+]soltysh commentedon Jan 13, 2016
David can you please take a look once more, I've applied all the changes you've asked for. I'm currently working on adding the existing tests rewritten to use the new framework so it's easy to compare. It's still in progress but the general idea should maintain.
soltysh commentedon Jan 20, 2016
David I think I've re-implemented, using the new style, all the methods from ThreadedNetworkedTests and ThreadedNetworkedTestsSSL, the new classes are NewIMAPTests and NewIMAPSSLTests accordingly.
soltysh commentedon May 26, 2016
David I'm uploading the patch with all the review comments addressed. The changes from just the review can be seen here: https://bitbucket.org/soltysh/cpython/commits/91708e0c6e7c5230bd69b1135b82ef47b6dc4d43?at=default (please ignore the changes to test_logincapa_withclient_certfile, these are not part of the final patch).
bitdancer commentedon Jul 19, 2016
Reitveld can diff patchsets, so I used that for review.
soltysh commentedon Jul 19, 2016
Thanks, I'll try to update the patch in the following days.
soltysh commentedon Sep 30, 2016
David I apologize for 2 emails from Reitveld, for some reason it didn't show me all in one view :/ (I need to master Reitveld better). I've just updated patch according to your comments.
bitdancer commentedon Dec 4, 2016
Revised patch LGTM. Once 3.6 is out the door I'll commit it, though you may need to remind me.
soltysh commentedon Dec 5, 2016
Thank you David, of course I'll remind you :)
python-dev commentedon Dec 25, 2016
New changeset 75f9cca86fa1 by R David Murray in branch '3.5':
bpo-25591: improve imap tests.
https://hg.python.org/cpython/rev/75f9cca86fa1
New changeset 4663466b0d66 by R David Murray in branch '3.6':
Merge: bpo-25591: improve imap tests.
https://hg.python.org/cpython/rev/4663466b0d66
New changeset 93d8cce449eb by R David Murray in branch 'default':
Merge: bpo-25591: improve imap tests.
https://hg.python.org/cpython/rev/93d8cce449eb
bitdancer commentedon Dec 25, 2016
Committed. FYI, I did have to make a few tweaks. There were several lines longer than 80 characters still that I wrapped. The tests failed with -W error:BytesWarning, something I normally run the tests with. That required a fix to the library (a decode on the error message...if anyone is depending on the error message being bytes instead of string I'm sorry, but I doubt anyone is. And finally, committing to 3.6 required adding the 'r' prefix to some of the tests regexes to eliminate the invalid escape warnings.
Thanks for your patience and persistence, Maciej.
python-dev commentedon Jan 12, 2017
New changeset a10d6ab65b23 by Victor Stinner in branch '3.5':
Issue bpo-25591: Fix test_imaplib if ssl miss
https://hg.python.org/cpython/rev/a10d6ab65b23