Fix linting issues

This commit is contained in:
Steve Dower 2018-11-21 14:13:45 -08:00
parent 60a08c838d
commit f4bdd28e25
2 changed files with 13 additions and 10 deletions

View File

@ -116,7 +116,8 @@ class AdjacentTempDirectory(TempDirectory):
for i in range(1, len(name)):
if name[i] in cls.LEADING_CHARS:
continue
for candidate in itertools.combinations_with_replacement(cls.LEADING_CHARS, i):
for candidate in itertools.combinations_with_replacement(
cls.LEADING_CHARS, i):
new_name = ''.join(candidate) + name[i:]
if new_name != name:
yield new_name

View File

@ -548,15 +548,16 @@ class TestTempDirectory(object):
assert tmp_dir.path is None
assert not os.path.exists(created_path)
@pytest.mark.parametrize("name",
[
"ABC",
"ABC.dist-info",
"_+-",
"_package",
])
@pytest.mark.parametrize("name", [
"ABC",
"ABC.dist-info",
"_+-",
"_package",
])
def test_adjacent_directory_names(self, name):
names = lambda: AdjacentTempDirectory._generate_names(name)
def names():
return AdjacentTempDirectory._generate_names(name)
chars = AdjacentTempDirectory.LEADING_CHARS
# Ensure many names are unique
@ -572,7 +573,8 @@ class TestTempDirectory(object):
assert not any(n == name for n in names())
# Check the first group are correct
assert all(x == y for x, y in zip(some_names, [c + name[1:] for c in chars]))
assert all(x == y for x, y in
zip(some_names, [c + name[1:] for c in chars]))
class TestGlibc(object):