def test_attach_file(browser, app_url):
    """should provide a way to change file field value"""
    browser.visit(app_url)

    file_path = pathlib.Path(
        os.getcwd(),  # NOQA PTH109
        "tests",
        "mockfile.txt",
    )

    browser.attach_file("file", str(file_path))
    browser.find_by_name("upload").click()

    html = browser.html
    assert "text/plain" in html
    with open(file_path) as f:
        assert f.read() in html
should provide a way to change file field value
tests/test_all_lxml_drivers/test_lxml_drivers.py