Skip to content

Commit 1c2eddd

Browse files
committed
Manual fixes of PT015
1 parent 9e26bdc commit 1c2eddd

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

tests/functional/test_invalid_versions_and_specifiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ def test_show_require_invalid_version(
136136
elif select_backend().NAME == "pkg_resources":
137137
assert "Required-by: \n" in result.stdout
138138
else:
139-
assert False, "Unknown metadata backend"
139+
pytest.fail("Unknown metadata backend")

tests/functional/test_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,4 +749,4 @@ def test_list_pep610_editable(script: PipTestEnvironment) -> None:
749749
assert item["editable_project_location"]
750750
break
751751
else:
752-
assert False, "package 'testpkg' not found in pip list result"
752+
pytest.fail("package 'testpkg' not found in pip list result")

tests/unit/test_network_auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def should_save_password_to_keyring(*a: Any) -> bool:
291291
# when _prompt_for_password indicates not to save, we should
292292
# never call this function
293293
def should_save_password_to_keyring(*a: Any) -> bool:
294-
assert False, "_should_save_password_to_keyring should not be called"
294+
pytest.fail("_should_save_password_to_keyring should not be called")
295295

296296
monkeypatch.setattr(
297297
auth, "_should_save_password_to_keyring", should_save_password_to_keyring
@@ -333,7 +333,7 @@ def __init__(self, username: str, password: str) -> None:
333333
self.password = password
334334

335335
def get_password(self, system: str, username: str) -> None:
336-
assert False, "get_password should not ever be called"
336+
pytest.fail("get_password should not ever be called")
337337

338338
def get_credential(self, system: str, username: str) -> Optional[Credential]:
339339
if system == "http://example.com/path2/":
@@ -507,7 +507,7 @@ def should_save_password_to_keyring(*a: Any) -> bool:
507507
# when _prompt_for_password indicates not to save, we should
508508
# never call this function
509509
def should_save_password_to_keyring(*a: Any) -> bool:
510-
assert False, "_should_save_password_to_keyring should not be called"
510+
pytest.fail("_should_save_password_to_keyring should not be called")
511511

512512
monkeypatch.setattr(
513513
auth, "_should_save_password_to_keyring", should_save_password_to_keyring

tests/unit/test_req_file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def get_file_content(
519519
return None, "-r reqs.txt"
520520
elif filename == "http://me.com/me/reqs.txt":
521521
return None, req_name
522-
assert False, f"Unexpected file requested {filename}"
522+
pytest.fail(f"Unexpected file requested {filename}")
523523

524524
monkeypatch.setattr(
525525
pip._internal.req.req_file, "get_file_content", get_file_content
@@ -588,7 +588,7 @@ def get_file_content(
588588
return None, f"-r {nested_req_file}"
589589
elif filename == nested_req_file:
590590
return None, req_name
591-
assert False, f"Unexpected file requested {filename}"
591+
pytest.fail(f"Unexpected file requested {filename}")
592592

593593
monkeypatch.setattr(
594594
pip._internal.req.req_file, "get_file_content", get_file_content

tests/unit/test_utils_retry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _raise_error() -> NoReturn:
4848
assert isinstance(e, RuntimeError)
4949
assert e is errors[-1]
5050
else:
51-
assert False, "unexpected return"
51+
assert pytest.fail("unexpected return")
5252

5353
assert function.call_count > 1, "expected at least one retry"
5454

0 commit comments

Comments
 (0)