Skip to content

Commit 6c86c96

Browse files
committed
Run ruff check . --select PT018 --fix + Manual fixes of asserts with messages
1 parent ce1e1e4 commit 6c86c96

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

tests/functional/test_pep517.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def test_backend(tmpdir: Path, data: TestData) -> None:
4444
finder = make_test_finder(find_links=[data.backends])
4545
env.install_requirements(finder, ["dummy_backend"], "normal", kind="Installing")
4646
conflicting, missing = env.check_requirements(["dummy_backend"])
47-
assert not conflicting and not missing
47+
assert not conflicting
48+
assert not missing
4849
assert hasattr(req.pep517_backend, "build_wheel")
4950
with env:
5051
assert req.pep517_backend is not None

tests/unit/metadata/test_metadata.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,17 @@ def test_dist_found_in_directory_named_whl(tmp_path: Path) -> None:
119119
info_path.joinpath("METADATA").write_text("Name: pkg")
120120
location = os.fspath(dir_path)
121121
dist = get_environment([location]).get_distribution("pkg")
122-
assert dist is not None and dist.location is not None
122+
assert dist is not None
123+
assert dist.location is not None
123124
assert Path(dist.location) == Path(location)
124125

125126

126127
def test_dist_found_in_zip(tmp_path: Path) -> None:
127128
location = os.fspath(tmp_path.joinpath("pkg.zip"))
128129
make_wheel(name="pkg", version="1").save_to(location)
129130
dist = get_environment([location]).get_distribution("pkg")
130-
assert dist is not None and dist.location is not None
131+
assert dist is not None
132+
assert dist.location is not None
131133
assert Path(dist.location) == Path(location)
132134

133135

tests/unit/test_collector.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,4 +1208,5 @@ def test_metadata_file_info_parsing_html(
12081208
page_url = "dummy_for_comes_from"
12091209
base_url = "https://index.url/simple"
12101210
link = Link.from_element(attribs, page_url, base_url)
1211-
assert link is not None and link.metadata_file_data == expected
1211+
assert link is not None
1212+
assert link.metadata_file_data == expected

tests/unit/test_req_uninstall.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,10 @@ def test_commit_symlinks(self, tmpdir: Path) -> None:
380380
# stash removed, links removed
381381
for stashed_path in stashed_paths:
382382
assert not os.path.lexists(stashed_path)
383-
assert not os.path.lexists(dirlink) and not os.path.isdir(dirlink)
384-
assert not os.path.lexists(filelink) and not os.path.isfile(filelink)
383+
assert not os.path.lexists(dirlink)
384+
assert not os.path.isdir(dirlink)
385+
assert not os.path.lexists(filelink)
386+
assert not os.path.isfile(filelink)
385387

386388
# link targets untouched
387389
assert os.path.isdir(adir)
@@ -412,8 +414,10 @@ def test_rollback_symlinks(self, tmpdir: Path) -> None:
412414
# stash removed, links restored
413415
for stashed_path in stashed_paths:
414416
assert not os.path.lexists(stashed_path)
415-
assert os.path.lexists(dirlink) and os.path.isdir(dirlink)
416-
assert os.path.lexists(filelink) and os.path.isfile(filelink)
417+
assert os.path.lexists(dirlink)
418+
assert os.path.isdir(dirlink)
419+
assert os.path.lexists(filelink)
420+
assert os.path.isfile(filelink)
417421

418422
# link targets untouched
419423
assert os.path.isdir(adir)

0 commit comments

Comments
 (0)