Skip to content

Commit 8cd8c8c

Browse files
committed
Add workaround for FrozenInstanceError on location.filepath
1 parent ac0419c commit 8cd8c8c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/integration/test_main.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import subprocess
44
from pathlib import Path
5-
from typing import TYPE_CHECKING
5+
from typing import TYPE_CHECKING, assert_type
66

77
import pytest
88
from hexdoc.cli.app import build, callback
@@ -28,7 +28,14 @@
2828

2929
def rename_snapshot(snapshot: SnapshotAssertion, index: str):
3030
location = snapshot.test_location
31-
location.filepath = location.filepath.replace(".py", f"_{index}.py") # TODO: hack
31+
32+
# TODO: hack
33+
assert_type(location.filepath, str)
34+
object.__setattr__(
35+
location,
36+
"filepath",
37+
location.filepath.replace(".py", f"_{index}.py"),
38+
)
3239

3340

3441
@pytest.fixture(scope="session", autouse=True)

0 commit comments

Comments
 (0)