Skip to content

refactor imaplib tests #69777

Closed
Closed

Description

@soltysh
BPO 25591
Nosy @warsaw, @bitdancer, @serhiy-storchaka, @soltysh
Files
  • new_imap_tests.diff: Initial proposal for imap tests
  • new_imap_tests_v2.diff: Tests with comments from David + with rewriten old tests
  • new_imap_tests_v3.diff
  • new_imap_tests_v3.diff: Re-generated for review
  • new_imap_tests_v4.diff
  • new_imap_tests_v5.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/soltysh'
    closed_at = <Date 2016-12-25.02:39:55.642>
    created_at = <Date 2015-11-09.22:16:47.729>
    labels = ['type-feature', '3.7', 'expert-email']
    title = 'refactor imaplib tests'
    updated_at = <Date 2017-01-12.10:54:19.171>
    user = 'https://github.com/soltysh'

    bugs.python.org fields:

    activity = <Date 2017-01-12.10:54:19.171>
    actor = 'python-dev'
    assignee = 'maciej.szulik'
    closed = True
    closed_date = <Date 2016-12-25.02:39:55.642>
    closer = 'r.david.murray'
    components = ['email']
    creation = <Date 2015-11-09.22:16:47.729>
    creator = 'maciej.szulik'
    dependencies = []
    files = ['40991', '41610', '41675', '41680', '43023', '44896']
    hgrepos = []
    issue_num = 25591
    keywords = ['patch']
    message_count = 14.0
    messages = ['254417', '256070', '256394', '258175', '258723', '266460', '270798', '270814', '277771', '282357', '282411', '283980', '283981', '285302']
    nosy_count = 5.0
    nosy_names = ['barry', 'r.david.murray', 'python-dev', 'serhiy.storchaka', 'maciej.szulik']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue25591'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    Activity

    1. soltysh commented on Nov 9, 2015

      @soltysh
      Author

      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.

    2. soltysh commented on Dec 7, 2015

      @soltysh
      Author

      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.

    3. soltysh commented on Dec 14, 2015

      @soltysh
      Author

      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:

      1. having single _setup method
      2. the _setup method should addClenup to clean the environment
      3. have stubs with implemented mostly used methods, all others should be implemented ad-hoc in test methods
      4. 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.

    4. changed the title [-]improve test coverage for the imaplib[/-] [+]refactor imaplib tests[/+] on Dec 14, 2015
    5. self-assigned this
      on Dec 14, 2015
    6. soltysh commented on Jan 13, 2016

      @soltysh
      Author

      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.

    7. soltysh commented on Jan 20, 2016

      @soltysh
      Author

      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.

    8. soltysh commented on May 26, 2016

      @soltysh
      Author

      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).

    9. bitdancer commented on Jul 19, 2016

      @bitdancer
      Member

      Reitveld can diff patchsets, so I used that for review.

    10. soltysh commented on Jul 19, 2016

      @soltysh
      Author

      Thanks, I'll try to update the patch in the following days.

    11. soltysh commented on Sep 30, 2016

      @soltysh
      Author

      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.

    12. bitdancer commented on Dec 4, 2016

      @bitdancer
      Member

      Revised patch LGTM. Once 3.6 is out the door I'll commit it, though you may need to remind me.

    13. soltysh commented on Dec 5, 2016

      @soltysh
      Author

      Thank you David, of course I'll remind you :)

    14. python-dev commented on Dec 25, 2016

      python-devmannequin
      Mannequin

      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

    15. bitdancer commented on Dec 25, 2016

      @bitdancer
      Member

      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.

    16. python-dev commented on Jan 12, 2017

      python-devmannequin
      Mannequin

      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

    17. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions