From 8cd8c8ccb7c5fe80db557dec08c3ec2067921aad Mon Sep 17 00:00:00 2001 From: object-Object Date: Wed, 5 Feb 2025 23:20:30 -0500 Subject: [PATCH] Add workaround for FrozenInstanceError on location.filepath --- test/integration/test_main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/integration/test_main.py b/test/integration/test_main.py index 64b7ff78..9ace6439 100644 --- a/test/integration/test_main.py +++ b/test/integration/test_main.py @@ -2,7 +2,7 @@ import subprocess from pathlib import Path -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, assert_type import pytest from hexdoc.cli.app import build, callback @@ -28,7 +28,14 @@ def rename_snapshot(snapshot: SnapshotAssertion, index: str): location = snapshot.test_location - location.filepath = location.filepath.replace(".py", f"_{index}.py") # TODO: hack + + # TODO: hack + assert_type(location.filepath, str) + object.__setattr__( + location, + "filepath", + location.filepath.replace(".py", f"_{index}.py"), + ) @pytest.fixture(scope="session", autouse=True)