From b60b0079c15624c5e3c419530d7234f3ae1f93f9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 19 May 2023 13:04:37 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B9=20Feed=20the=20hobgoblins=20(delin?= =?UTF-8?q?t).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setuptools/tests/test_easy_install.py | 36 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index b2551dbce9..abda55ac8d 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -338,8 +338,10 @@ def test_add_from_site_is_ignored(self): assert not pth.dirty def test_many_pth_distributions_merge_together(self, tmpdir): - """Make sure that if the pth file is modified under the hood then PthDistribution - will refresh its content before saving, and merging contents when necessary. + """ + If the pth file is modified under the hood, then PthDistribution + will refresh its content before saving, merging contents when + necessary. """ # putting the pth file in a dedicated sub-folder, pth_subdir = tmpdir.join("pth_subdir") @@ -347,8 +349,9 @@ def test_many_pth_distributions_merge_together(self, tmpdir): pth_path = str(pth_subdir.join("file1.pth")) pth1 = PthDistributions(pth_path) pth2 = PthDistributions(pth_path) - assert pth1.paths == pth2.paths == [], \ - "unless there would be some default added at some point" + assert ( + pth1.paths == pth2.paths == [] + ), "unless there would be some default added at some point" # and so putting the src_subdir in folder distinct than the pth one, # so to keep it absolute by PthDistributions new_src_path = tmpdir.join("src_subdir") @@ -356,21 +359,26 @@ def test_many_pth_distributions_merge_together(self, tmpdir): new_src_path_str = str(new_src_path) pth1.paths.append(new_src_path_str) pth1.save() - assert pth1.paths, \ - "first, the new_src_path added must still be present/valid in pth1 after save" + assert ( + pth1.paths + ), "the new_src_path added must still be present/valid in pth1 after save" # now, - assert new_src_path_str not in pth2.paths, \ - "right before we save the entry should still not be present" + assert ( + new_src_path_str not in pth2.paths + ), "right before we save the entry should still not be present" pth2.save() - assert new_src_path_str in pth2.paths, \ - "the new_src_path entry should have been added by pth2 with its save() call now" - assert pth2.paths[-1] == new_src_path, \ - "and it should match exactly on the last entry actually " \ + assert ( + new_src_path_str in pth2.paths + ), "the new_src_path entry should have been added by pth2 with its save() call" + assert pth2.paths[-1] == new_src_path, ( + "and it should match exactly on the last entry actually " "given we append to it in save()" + ) # finally, - assert PthDistributions(pth_path).paths == pth2.paths, \ - "and we should have the exact same list at the end " \ + assert PthDistributions(pth_path).paths == pth2.paths, ( + "and we should have the exact same list at the end " "with a fresh PthDistributions instance" + ) @pytest.fixture