Skip to content

Commit 605b946

Browse files
committed
test: enable PT011
1 parent ef27879 commit 605b946

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ ignore = [
239239
"E501",
240240
"D1",
241241
"D415",
242-
"PT011", # TODO(bearomorphism): enable this rule
243242
"PT022", # TODO(bearomorphism): enable this rule
244243
]
245244
extend-safe-fixes = [

tests/commands/test_commit_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ def test_commit_when_customized_expected_raised(config, mocker: MockFixture):
248248

249249
@pytest.mark.usefixtures("staging_is_clean")
250250
def test_commit_when_non_customized_expected_raised(config, mocker: MockFixture):
251-
mocker.patch("questionary.prompt", side_effect=ValueError())
252-
with pytest.raises(ValueError):
251+
mocker.patch("questionary.prompt", side_effect=ValueError("error message"))
252+
with pytest.raises(ValueError, match="error message"):
253253
commands.Commit(config, {})()
254254

255255

tests/test_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_from_str_with_invalid_values():
3030
"""Test from_str with invalid values."""
3131
with pytest.raises(KeyError):
3232
ExitCode.from_str("invalid_name")
33-
with pytest.raises(ValueError):
33+
with pytest.raises(ValueError, match="is not a valid ExitCode"):
3434
ExitCode.from_str("999") # Out of range decimal
3535
with pytest.raises(KeyError):
3636
ExitCode.from_str("")

0 commit comments

Comments
 (0)