diff --git a/doc/en/example/assertion/failure_demo.py b/doc/en/example/assertion/failure_demo.py index 4bf827904..a172a007e 100644 --- a/doc/en/example/assertion/failure_demo.py +++ b/doc/en/example/assertion/failure_demo.py @@ -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()