@@ -338,39 +338,47 @@ def test_add_from_site_is_ignored(self):
338
338
assert not pth .dirty
339
339
340
340
def test_many_pth_distributions_merge_together (self , tmpdir ):
341
- """Make sure that if the pth file is modified under the hood then PthDistribution
342
- will refresh its content before saving, and merging contents when necessary.
341
+ """
342
+ If the pth file is modified under the hood, then PthDistribution
343
+ will refresh its content before saving, merging contents when
344
+ necessary.
343
345
"""
344
346
# putting the pth file in a dedicated sub-folder,
345
347
pth_subdir = tmpdir .join ("pth_subdir" )
346
348
pth_subdir .mkdir ()
347
349
pth_path = str (pth_subdir .join ("file1.pth" ))
348
350
pth1 = PthDistributions (pth_path )
349
351
pth2 = PthDistributions (pth_path )
350
- assert pth1 .paths == pth2 .paths == [], \
351
- "unless there would be some default added at some point"
352
+ assert (
353
+ pth1 .paths == pth2 .paths == []
354
+ ), "unless there would be some default added at some point"
352
355
# and so putting the src_subdir in folder distinct than the pth one,
353
356
# so to keep it absolute by PthDistributions
354
357
new_src_path = tmpdir .join ("src_subdir" )
355
358
new_src_path .mkdir () # must exist to be accounted
356
359
new_src_path_str = str (new_src_path )
357
360
pth1 .paths .append (new_src_path_str )
358
361
pth1 .save ()
359
- assert pth1 .paths , \
360
- "first, the new_src_path added must still be present/valid in pth1 after save"
362
+ assert (
363
+ pth1 .paths
364
+ ), "the new_src_path added must still be present/valid in pth1 after save"
361
365
# now,
362
- assert new_src_path_str not in pth2 .paths , \
363
- "right before we save the entry should still not be present"
366
+ assert (
367
+ new_src_path_str not in pth2 .paths
368
+ ), "right before we save the entry should still not be present"
364
369
pth2 .save ()
365
- assert new_src_path_str in pth2 .paths , \
366
- "the new_src_path entry should have been added by pth2 with its save() call now"
367
- assert pth2 .paths [- 1 ] == new_src_path , \
368
- "and it should match exactly on the last entry actually " \
370
+ assert (
371
+ new_src_path_str in pth2 .paths
372
+ ), "the new_src_path entry should have been added by pth2 with its save() call"
373
+ assert pth2 .paths [- 1 ] == new_src_path , (
374
+ "and it should match exactly on the last entry actually "
369
375
"given we append to it in save()"
376
+ )
370
377
# finally,
371
- assert PthDistributions (pth_path ).paths == pth2 .paths , \
372
- "and we should have the exact same list at the end " \
378
+ assert PthDistributions (pth_path ).paths == pth2 .paths , (
379
+ "and we should have the exact same list at the end "
373
380
"with a fresh PthDistributions instance"
381
+ )
374
382
375
383
376
384
@pytest .fixture
0 commit comments