import pathlib
import json


def trap_json(request) -> dict:
    """Get trap json test data."""
    file = pathlib.Path(request.node.fspath)
    file_path = file.with_name("trap.json")
    with open(file_path) as json_file:
        return json.load(json_file)