parent
678c1a0745
commit
9db9f04432
|
@ -1,4 +1,3 @@
|
||||||
import _pytest._code
|
|
||||||
import pytest
|
import pytest
|
||||||
from pytest import raises
|
from pytest import raises
|
||||||
|
|
||||||
|
@ -197,7 +196,7 @@ def test_dynamic_compile_shows_nicely():
|
||||||
name = "abc-123"
|
name = "abc-123"
|
||||||
spec = importlib.util.spec_from_loader(name, loader=None)
|
spec = importlib.util.spec_from_loader(name, loader=None)
|
||||||
module = importlib.util.module_from_spec(spec)
|
module = importlib.util.module_from_spec(spec)
|
||||||
code = _pytest._code.compile(src, name, "exec")
|
code = compile(src, name, "exec")
|
||||||
exec(code, module.__dict__)
|
exec(code, module.__dict__)
|
||||||
sys.modules[name] = module
|
sys.modules[name] = module
|
||||||
module.foo()
|
module.foo()
|
||||||
|
|
Loading…
Reference in New Issue