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 vstinner
Recipients Dormouse759, docs@python, miss-islington, ncoghlan, petr.viktorin, pitrou, scoder, vstinner
Date 2018-05-24.20:24:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527193442.91.0.682650639539.issue32374@psf.upfronthosting.co.za>
In-reply-to
Content
MultiPhaseExtensionModuleTests.test_bad_traverse() of Lib/test/test_importlib/extension/test_loader.py runs the following code:
---
import importlib.util as util
spec = util.find_spec('_testmultiphase')
spec.name = '_testmultiphase_with_bad_traverse'
m = spec.loader.create_module(spec)
---

And then check that the Python "failed": that the exit code is non-zero...

That's a weak test: if the script fails before calling spec.loader.create_module(), the test also pass. If the function raises an exception but don't crash, the test pass as well.

More generally, I'm not sure about the idea of making sure that doing bad stuff with traverse does crash. What is the purpose of the test?

In the meanwhile, I fixed bpo-33629 by adding test.support.SuppressCrashReport().

I'm not asking to do something. Maybe it's fine to keep the current test.
History
Date User Action Args
2018-05-24 20:24:02vstinnersetrecipients: + vstinner, ncoghlan, pitrou, scoder, petr.viktorin, docs@python, Dormouse759, miss-islington
2018-05-24 20:24:02vstinnersetmessageid: <1527193442.91.0.682650639539.issue32374@psf.upfronthosting.co.za>
2018-05-24 20:24:02vstinnerlinkissue32374 messages
2018-05-24 20:24:02vstinnercreate