Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ reportUnknownVariableType = false
reportUnnecessaryComparison = false
reportUnnecessaryIsInstance = false
reportUnnecessaryTypeIgnoreComment = false
reportUnreachable = false
reportUnusedCallResult = false
reportUnusedParameter = false

[[tool.basedpyright.executionEnvironments]]
root = "tests"
reportUnreachable = false
reportUnusedFunction = false

[tool.sync-with-uv.repo-to-package]
Expand Down
14 changes: 0 additions & 14 deletions src/usethis/_file/ini/io_.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,6 @@ def _set_value_in_option(
def _validated_set(
*, root: INIDocument, section_key: Key, option_key: Key, value: str | list[str]
) -> None:
if not isinstance(value, str | list):
msg = (
f"INI files only support strings (or lists of strings), but a "
f"{type(value)} was provided."
)
raise InvalidINITypeError(msg)

if not isinstance(section_key, str) or not isinstance(option_key, str):
msg = (
f"Only hard-coded strings are supported as keys when "
Expand All @@ -319,13 +312,6 @@ def _validated_set(
def _validated_append(
*, root: INIDocument, section_key: Key, option_key: Key, value: str
) -> None:
if not isinstance(value, str):
msg = (
f"INI files only support strings (or lists of strings), but a "
f"{type(value)} was provided."
)
raise InvalidINITypeError(msg)

if not isinstance(section_key, str) or not isinstance(option_key, str):
msg = (
f"Only hard-coded strings are supported as keys when "
Expand Down
17 changes: 0 additions & 17 deletions tests/usethis/_file/ini/test_ini_io_.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,23 +574,6 @@ def relative_path(self) -> Path:
"""
)

def test_int(self, tmp_path: Path):
# Arrange
class MyINIFileManager(INIFileManager):
@property
def relative_path(self) -> Path:
return Path("valid.ini")

valid_file = tmp_path / "valid.ini"
valid_file.touch()
# Act
with (
change_cwd(tmp_path),
MyINIFileManager() as manager,
pytest.raises(TypeError),
):
manager.set_value(keys=["section"], value={"key": 1}, exists_ok=True)

def test_no_spacing_roundtrip(self, tmp_path: Path):
# Arrange
class MyINIFileManager(INIFileManager):
Expand Down
Loading