Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
new_module(name) -> module
Create a new module.  Do not enter it in sys.modules.
The module name must include the full package name, if any.

src/p/y/pytest-2.5.2/doc/ja/example/assertion/failure_demo.py   pytest(Download)
def test_dynamic_compile_shows_nicely():
    src = 'def foo():\n assert 1 == 0\n'
    name = 'abc-123'
    module = py.std.imp.new_module(name)
    code = py.code.compile(src, name, 'exec')

src/p/y/pytest-2.5.2/doc/en/example/assertion/failure_demo.py   pytest(Download)
def test_dynamic_compile_shows_nicely():
    src = 'def foo():\n assert 1 == 0\n'
    name = 'abc-123'
    module = py.std.imp.new_module(name)
    code = py.code.compile(src, name, 'exec')