Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup_env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
- name: Setup uv
uses: astral-sh/setup-uv@v8.1.0
uses: astral-sh/setup-uv@v8.2.0
with:
activate-environment: true
cache-dependency-glob: |
Expand Down
12 changes: 3 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ requires = ["hatchling"]
[dependency-groups]
dev = [
"pyinstaller",
"ruff",
"pytest",
"pytest-cov",
"pytest-env",
"pytest-mock",
"pytest-pythonpath",
"pytest-xdist",
"typing-extensions"
"pytest-xdist"
]

[project]
dependencies = [
"beautifultable",
"colorama",
"httpx",
"jsonpath",
"keyboard",
"lxml",
"mouse",
Expand All @@ -31,19 +29,15 @@ dependencies = [
"psutil",
"pydantic",
"pydantic-numpy",
"pydantic-yaml",
"pyqt6",
"python-jsonpath",
"pytweening",
"pywin32; sys_platform == 'win32'",
"pyyaml",
"rapidfuzz",
"ruamel-yaml",
"ruff",
"selenium",
"seleniumbase",
"tk",
"webdriver-manager"
"seleniumbase"
]
dynamic = ["version"]
name = "d4lf"
Expand Down
25 changes: 25 additions & 0 deletions tests/gui/importer/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
import pathlib
import tempfile

import pytest
from seleniumbase import Driver
from seleniumbase.core.browser_launcher import override_driver_dir as seleniumbase_override_driver_dir

from src.gui.importer import gui_common


@pytest.fixture
def isolate_uc_driver_dir(monkeypatch) -> None:
driver_dir = (
pathlib.Path(tempfile.gettempdir())
/ "d4lf"
/ "seleniumbase-drivers"
/ f"{os.getenv('PYTEST_XDIST_WORKER', 'main')}-{os.getpid()}"
)
driver_dir.mkdir(parents=True, exist_ok=True)
monkeypatch.setattr(
gui_common,
"Driver",
lambda *args, **kwargs: seleniumbase_override_driver_dir(str(driver_dir)) or Driver(*args, **kwargs),
)
2 changes: 2 additions & 0 deletions tests/gui/importer/test_d4builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from src.gui.importer.importer_config import ImportConfig
from src.gui.importer.paragon_export import build_paragon_profile_payload

pytestmark = pytest.mark.usefixtures("isolate_uc_driver_dir")

if typing.TYPE_CHECKING:
from pytest_mock import MockerFixture
IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"
Expand Down
4 changes: 4 additions & 0 deletions tests/gui/importer/test_gui_common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import pytest

from src.config.profile_models import ProfileModel
from src.gui.importer.gui_common import _to_yaml_str, build_default_profile_file_name

pytestmark = pytest.mark.usefixtures("isolate_uc_driver_dir")


def test_build_default_profile_file_name_maxroll() -> None:
file_name = build_default_profile_file_name(
Expand Down
2 changes: 2 additions & 0 deletions tests/gui/importer/test_maxroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from src.gui.importer.paragon_export import build_paragon_profile_payload, extract_maxroll_paragon_steps
from src.item.data.item_type import ItemType

pytestmark = pytest.mark.usefixtures("isolate_uc_driver_dir")

if typing.TYPE_CHECKING:
from pytest_mock import MockerFixture
IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"
Expand Down
2 changes: 2 additions & 0 deletions tests/gui/importer/test_mobalytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
)
from src.gui.importer.paragon_export import build_paragon_profile_payload, extract_mobalytics_paragon_steps

pytestmark = pytest.mark.usefixtures("isolate_uc_driver_dir")

if typing.TYPE_CHECKING:
from pytest_mock import MockerFixture
IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"
Expand Down
105 changes: 16 additions & 89 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.