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 paul.moore
Recipients jafo, paul.moore, shireenrao, steve.dower, terry.reedy, tim.golden, zach.ware
Date 2019-08-08.21:07:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565298475.89.0.97357555618.issue25172@roundup.psfhosted.org>
In-reply-to
Content
That's where I decided it was too complex for now :-)

The whole test_crypt.py file is skipped if you can't import crypt, via the use of the test.support.import_module() function. To be able to write a test for a platform where the whole point is that you can't import crypt, you'd have to rewrite that. So you'd get something like

try:
    import crypt
except ImportError as e:
    if sys.platform == "win32":
        assert "not supported" in e.msg
    raise unittest.SkipTest("crypt is not present on this platform")

But you can't use "assert" like that in top-level code (or at least I don't think you can - I'm not that familiar with unittest, but I think assertions have to live in classes in unittest).

At this point I gave up. It starts to be quite a big rewrite for a relatively minor benefit.

The alternative would be, if there was a "Windows-specific tests" test module, we could have put a test for this situation in there. But I don't think there is such a module.
History
Date User Action Args
2019-08-08 21:07:55paul.mooresetrecipients: + paul.moore, terry.reedy, jafo, tim.golden, zach.ware, steve.dower, shireenrao
2019-08-08 21:07:55paul.mooresetmessageid: <1565298475.89.0.97357555618.issue25172@roundup.psfhosted.org>
2019-08-08 21:07:55paul.moorelinkissue25172 messages
2019-08-08 21:07:55paul.moorecreate