From ffb2c86bec12ca429b6afba2e1d9234c83a2ba67 Mon Sep 17 00:00:00 2001 From: Joshua Fehler Date: Fri, 14 Jun 2024 08:57:16 -0400 Subject: [PATCH] fixup --- tests/tests_webdriver/test_webdriver.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/tests_webdriver/test_webdriver.py b/tests/tests_webdriver/test_webdriver.py index f35ae376f..4ea736839 100644 --- a/tests/tests_webdriver/test_webdriver.py +++ b/tests/tests_webdriver/test_webdriver.py @@ -1,4 +1,5 @@ import os +import pathlib import pytest from selenium.common.exceptions import WebDriverException @@ -22,14 +23,19 @@ def test_webdriver_local_driver_not_present(browser_name): Browser(browser_name, service=service) +@pytest.mark.doit def test_attach_file(request, browser): """Should provide a way to change file field value""" request.addfinalizer(browser.quit) - file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "mockfile.txt") + file_path = pathlib.Path( + os.getcwd(), # NOQA PTH109 + "tests", + "mockfile.txt", + ) browser.visit(EXAMPLE_APP) - browser.attach_file("file", file_path) + browser.attach_file("file", str(file_path)) browser.find_by_name("upload").click() html = browser.html