How to use the retype.retype_path function in retype

To help you get started, we’ve selected a few retype examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ambv / retype / tests / test_retype.py View on Github external
def test_can_run_against_current_directory(tmp_path):
    # Regression test for `retype --pyi-dir . --target-dir . .`
    (tmp_path / "main.py").write_text("print('hello!')")
    pwd = Path(".")
    errors = []
    with as_cwd(tmp_path):
        for path, exc_msg, exc_type, exc_tb in retype_path(pwd, pwd, pwd):
            errors.append((path, exc_msg, exc_type, exc_tb))
    assert not errors