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.

Author r.david.murray
Recipients jesstess, maciej.szulik, pitrou, r.david.murray, zvyn
Date 2015-12-13.19:54:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450036447.72.0.0834742166973.issue22137@psf.upfronthosting.co.za>
In-reply-to
Content
I'm afraid I don't remember the details of our conversations at PyCon.  Specifically, I don't remember what problem(s) it is you are trying to solve with this patch.

What is the reason for not just adding your new tests to the ThreadedNetworkTests test case?  That way they would be run both in regular mode and SSL mode.  You seem to have copied bits of the code from that test into yours, but it mostly moves the code away from our usual conventions.  That is, we generally put the support classes at the top level and then subclass them in test methods that need variations, rather than defining them in setup methods (where they would inaccessible unless assigned to self).  Also, the existing reap_server method is to be preferred over a chain of addCleanups.  Finally, we are moving all tests to using unittest.main() so that they can be called using unittest only instead of requiring regrtest, so the change in the __main__ block is incorrect.

Now, all that said, I can see several things I'd do to refactor the existing tests to make them clearer and easier to modify.  For example, there are better ways to get reap_threads called on all test methods than wrapping each one individually (ex: tearDownClass).  And I prefer setup methods that do addCleanup (in this case, addCleanup(self.reap_server), rather than the existing context manager approach, though I don't know how widespread my preferred pattern is in our test suite yet.

All of which has little to do with the title of this issue :).  So, perhaps we should open a new issue for refactoring the tests, and then come back to this one once we are both satisfied with the refactoring?  We can cite this issue as the motivation for the refactoring.
History
Date User Action Args
2015-12-13 19:54:07r.david.murraysetrecipients: + r.david.murray, pitrou, jesstess, maciej.szulik, zvyn
2015-12-13 19:54:07r.david.murraysetmessageid: <1450036447.72.0.0834742166973.issue22137@psf.upfronthosting.co.za>
2015-12-13 19:54:07r.david.murraylinkissue22137 messages
2015-12-13 19:54:05r.david.murraycreate