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 terry.reedy
Recipients jafo, paul.moore, shireenrao, steve.dower, terry.reedy, tim.golden, zach.ware
Date 2019-08-07.00:41:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565138479.84.0.82637510798.issue25172@roundup.psfhosted.org>
In-reply-to
Content
I agree with Paul about the wording.  Note that the proposed platform-specific catch and raise are for crypt.py, not test_crypt.py.

If a test module should be skipped entirely, import_module is correct.  For more refinement, test_idle has, for example,

tk = import_module('tkinter')  # Also imports _tkinter.
if tk.TkVersion < 8.5:
    raise unittest.SkipTest("IDLE requires tk 8.5 or later.")

Testing only continues if tkinter and _tkinter and tk >= 8.5.

I presume that crypt = import_module('crypt') will only continue if crypt and  _crypt, which is what you want.  It is apparently not an error for _crypt to be missing on unix, just an inconvenience for people who expect it.

FYI, Individual test classes and methods can be skipped with
    @unittest.skipIf(condition, message)  # example
    @unittest.skipIf(sys.platform != 'darwin', 'test macOS-only code')
See the unittest doc for more, though apparently not needed here.
History
Date User Action Args
2019-08-07 00:41:19terry.reedysetrecipients: + terry.reedy, paul.moore, jafo, tim.golden, zach.ware, steve.dower, shireenrao
2019-08-07 00:41:19terry.reedysetmessageid: <1565138479.84.0.82637510798.issue25172@roundup.psfhosted.org>
2019-08-07 00:41:19terry.reedylinkissue25172 messages
2019-08-07 00:41:19terry.reedycreate
Morty Proxy This is a proxified and sanitized view of the page, visit original site.