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