def METHOD_NAME(resources, outpdf):
    readme_filename = Path(__file__).parent.with_name('README.md')
    if not readme_filename.exists():  # In case it's not in some sdist/wheel/etc.
        pytest.skip('no README')
    readme = readme_filename.read_text()
    code_lines = []
    keep = False
    for line in readme.splitlines():
        if line.startswith('```python'):
            assert (
                not code_lines
            ), "Test suite only allows one block of Python in README"
            keep = True
            continue
        elif line.startswith('```'):
            keep = False
        if keep:
            code_lines.append(line)
    code = '\n'.join(code_lines)
    assert ast.parse(code), "Code in README.md does not parse"
    code = code.replace("'input.pdf'", "resources / 'sandwich.pdf'")
    code = code.replace("'output.pdf'", "outpdf")
    exec(  # pylint: disable=exec-used
        code, globals(), dict(resources=resources, outpdf=outpdf)
    )