Skip to content

Commit 4876287

Browse files
committed
Use sets when comparing os.listdir output.
1 parent 672f6f3 commit 4876287

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

tests/test_paths.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def test_copytree():
358358

359359
copytree(srcdir, destdir)
360360

361-
assert os.listdir(srcdir) == os.listdir(destdir)
361+
assert set(os.listdir(srcdir)) == set(os.listdir(destdir))
362362

363363
assert (destdir / "root.txt").exists()
364364
assert (destdir / "root.txt").is_file()
@@ -411,7 +411,7 @@ def test_copytree_exists():
411411

412412
copytree(srcdir, destdir)
413413

414-
assert os.listdir(srcdir) == os.listdir(destdir)
414+
assert set(os.listdir(srcdir)) == set(os.listdir(destdir))
415415

416416
assert (destdir / "root.txt").exists()
417417
assert (destdir / "root.txt").is_file()

tests/test_utils.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -383,36 +383,6 @@ def test_posargs2kwargs(args, posarg_names, kwargs, expects):
383383
assert utils.posargs2kwargs(args, posarg_names, kwargs) == expects
384384

385385

386-
def test_word_join():
387-
assert utils.word_join([]) == ''
388-
389-
assert utils.word_join(["bob"]) == "bob"
390-
assert utils.word_join(["bob", "alice"]) == "bob and alice"
391-
assert utils.word_join(["bob", "alice", "fred"]) == "bob, alice and fred"
392-
393-
assert utils.word_join(["bob"], use_repr=True) == "'bob'"
394-
assert utils.word_join(["bob", "alice"], use_repr=True) == "'bob' and 'alice'"
395-
assert utils.word_join(["bob", "alice", "fred"], use_repr=True) == "'bob', 'alice' and 'fred'"
396-
397-
assert utils.word_join(["bob"], use_repr=True, oxford=True) == "'bob'"
398-
assert utils.word_join(["bob", "alice"], use_repr=True, oxford=True) == "'bob' and 'alice'"
399-
assert utils.word_join(["bob", "alice", "fred"], use_repr=True, oxford=True) == "'bob', 'alice', and 'fred'"
400-
401-
assert utils.word_join(()) == ''
402-
403-
assert utils.word_join(("bob", )) == "bob"
404-
assert utils.word_join(("bob", "alice")) == "bob and alice"
405-
assert utils.word_join(("bob", "alice", "fred")) == "bob, alice and fred"
406-
407-
assert utils.word_join(("bob", ), use_repr=True) == "'bob'"
408-
assert utils.word_join(("bob", "alice"), use_repr=True) == "'bob' and 'alice'"
409-
assert utils.word_join(("bob", "alice", "fred"), use_repr=True) == "'bob', 'alice' and 'fred'"
410-
411-
assert utils.word_join(("bob", ), use_repr=True, oxford=True) == "'bob'"
412-
assert utils.word_join(("bob", "alice"), use_repr=True, oxford=True) == "'bob' and 'alice'"
413-
assert utils.word_join(("bob", "alice", "fred"), use_repr=True, oxford=True) == "'bob', 'alice', and 'fred'"
414-
415-
416386
def test_convert_indents():
417387

418388
# TODO: test 'to'

0 commit comments

Comments
 (0)