Skip to content

load_json_X_fixture calculates the wrong pathΒ #197

@Taraman17

Description

@Taraman17

The json versions of the load_fixture function get the wrong path and I get the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/home/vscode/.local/ha-venv/lib/python3.12/site-packages/pytest_homeassistant_custom_component/components/fixtures/group1.json'

The problem is here:

start_path = traceback.extract_stack()[-3].filename

If load_fixture is called via another function, you have to go one step further back in the stack, making it -4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions