def test_runtime_entry_point_broken_at_main(self):
# try the above, but do this through main
stub_stdouts(self)
ep = pkg_resources.EntryPoint.parse('broken = some.broken:instance')
ep.load = fake_error(ImportError)
working_set = mocks.WorkingSet({'calmjs.runtime': [ep]})
with self.assertRaises(SystemExit):
runtime.main(
['-h'],
runtime_cls=lambda: runtime.Runtime(working_set=working_set)
)
out = sys.stdout.getvalue()
err = sys.stderr.getvalue()
self.assertNotIn('broken', out)
self.assertIn('broken', err)
评论列表
文章目录