Skip to content

Commit

Permalink
Add workaround for FrozenInstanceError on location.filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
object-Object committed Feb 6, 2025
1 parent ac0419c commit 8cd8c8c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/integration/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 8cd8c8c

Please sign in to comment.