Message349254
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. |
|
Date |
User |
Action |
Args |
2019-08-08 21:07:55 | paul.moore | set | recipients:
+ paul.moore, terry.reedy, jafo, tim.golden, zach.ware, steve.dower, shireenrao |
2019-08-08 21:07:55 | paul.moore | set | messageid: <1565298475.89.0.97357555618.issue25172@roundup.psfhosted.org> |
2019-08-08 21:07:55 | paul.moore | link | issue25172 messages |
2019-08-08 21:07:55 | paul.moore | create | |
|