Merge pull request #399 from exercism/behrtam-update-flake8

Update flake8 and adapt pycodestyle 2.2
This commit is contained in:
Tammo Behrends
2016-11-30 10:06:10 +01:00
committed by GitHub
34 changed files with 35 additions and 4 deletions

View File

@@ -67,5 +67,6 @@ class AnagramTests(unittest.TestCase):
detect_anagrams('go', 'go Go GO'.split())
)
if __name__ == '__main__':
unittest.main()

View File

@@ -66,5 +66,6 @@ class BeerTest(unittest.TestCase):
"99 bottles of beer on the wall.\n\n"
)
if __name__ == '__main__':
unittest.main()

View File

@@ -37,5 +37,6 @@ class BinarySearchTests(unittest.TestCase):
def test_empty_array(self):
self.assertRaises(ValueError, binary_search, [], 1)
if __name__ == '__main__':
unittest.main()

View File

@@ -44,5 +44,6 @@ class BinaryTests(unittest.TestCase):
def test_invalid_binary_text_with_numbers(self):
self.assertRaises(ValueError, parse_binary, "nope10")
if __name__ == '__main__':
unittest.main()

View File

@@ -119,5 +119,6 @@ class BobTests(unittest.TestCase):
'Whatever.', bob.hey('This is a statement with trailing whitespace ')
)
if __name__ == '__main__':
unittest.main()

View File

@@ -157,5 +157,6 @@ class ClockTest(unittest.TestCase):
def test_clocks_with_negative_hours_and_minutes_that_wrap(self):
self.assertEqual(Clock(18, 7), Clock(-54, -11513))
if __name__ == '__main__':
unittest.main()

View File

@@ -49,5 +49,6 @@ class TransformTest(unittest.TestCase):
self.assertEqual(expected, etl.transform(old))
if __name__ == '__main__':
unittest.main()

View File

@@ -45,5 +45,6 @@ class GigasecondTest(unittest.TestCase):
add_gigasecond(your_birthday)
)
if __name__ == '__main__':
unittest.main()

View File

@@ -32,5 +32,6 @@ class GrainsTest(unittest.TestCase):
self.assertEqual(9223372036854775808, on_square(64))
self.assertEqual(18446744073709551615, total_after(64))
if __name__ == '__main__':
unittest.main()

View File

@@ -19,5 +19,6 @@ class YearTest(unittest.TestCase):
def test_exceptional_century(self):
self.assertIs(is_leap_year(2400), True)
if __name__ == '__main__':
unittest.main()

View File

@@ -62,5 +62,6 @@ class MeetupTest(unittest.TestCase):
self.assertRaises(MeetupDayException, meetup_day,
2015, 2, 'Monday', '5th')
if __name__ == '__main__':
unittest.main()

View File

@@ -37,5 +37,6 @@ class DNATest(unittest.TestCase):
expected = {'A': 20, 'T': 21, 'G': 17, 'C': 12}
self.assertEqual(expected, nucleotide_counts(dna))
if __name__ == '__main__':
unittest.main()

View File

@@ -6,6 +6,7 @@ def split_ocr(ocr):
return [[ocr[i][COL * j:COL * (j + 1)] for i in range(ROW)]
for j in range(len(ocr[0]) // COL)]
ALL = [' _ _ _ _ _ _ _ _ ',
' | _| _||_||_ |_ ||_||_|| |',
' ||_ _| | _||_| ||_| _||_|',

View File

@@ -102,5 +102,6 @@ class OcrTest(unittest.TestCase):
def test_invalid_grid(self):
self.assertRaises(ValueError, grid, '123a')
if __name__ == '__main__':
unittest.main()

View File

@@ -38,5 +38,6 @@ class PerfectNumbersTest(unittest.TestCase):
def test_seventh_perfect_number(self):
self.assertTrue(is_perfect(137438691328))
if __name__ == '__main__':
unittest.main()

View File

@@ -36,5 +36,6 @@ class PhoneTest(unittest.TestCase):
number = Phone("11234567890")
self.assertEqual("(123) 456-7890", number.pretty())
if __name__ == '__main__':
unittest.main()

View File

@@ -49,5 +49,6 @@ class PigLatinTests(unittest.TestCase):
def test_word_beginning_with_xr(self):
self.assertEqual("xrayay", translate("xray"))
if __name__ == '__main__':
unittest.main()

View File

@@ -31,5 +31,6 @@ class DNATest(unittest.TestCase):
self.assertEqual(5, hamming_distance('GACTACGGACAGGGTAGGGAAT',
'GACATCGCACACC'))
if __name__ == '__main__':
unittest.main()

View File

@@ -101,5 +101,6 @@ class PokerTest(unittest.TestCase):
self.assertEqual([spadeStraightTo9, diamondStraightTo9],
poker([spadeStraightTo9, diamondStraightTo9, threeOf4]))
if __name__ == '__main__':
unittest.main()

View File

@@ -37,5 +37,6 @@ class PrimeFactorsTest(unittest.TestCase):
def test_93819012551(self):
self.assertEqual([11, 9539, 894119], prime_factors(93819012551))
if __name__ == '__main__':
unittest.main()

View File

@@ -14,9 +14,7 @@ def primitive_triplets(nbr):
factors = [(m, n) for m, n in zip(reversed(a), a) if m > n]
ts = set()
for m, n in factors:
l = [nbr, m * m - n * n, m * m + n * n]
l.sort()
ts.update([tuple(l)])
ts.update([tuple(sorted([nbr, m * m - n * n, m * m + n * n]))])
return ts
@@ -36,6 +34,7 @@ def triplets_in_range(m, n):
t.update([(a, b, c)])
return t
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137,
139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211,

View File

@@ -30,5 +30,6 @@ class RailFenceTests(unittest.TestCase):
decode('133714114238148966225439541018335470986172518171757571896261', 6)
)
if __name__ == '__main__':
unittest.main()

View File

@@ -52,5 +52,6 @@ class RaindropsTest(unittest.TestCase):
def test_12121(self):
self.assertEqual("12121", raindrops(12121))
if __name__ == '__main__':
unittest.main()

View File

@@ -68,5 +68,6 @@ class WordTest(unittest.TestCase):
]
assert 2 == count(lines)
if __name__ == '__main__':
unittest.main()

View File

@@ -69,5 +69,6 @@ class RobotTests(unittest.TestCase):
self.assertEqual((11, 5), robot.coordinates)
self.assertEqual(NORTH, robot.bearing)
if __name__ == '__main__':
unittest.main()

View File

@@ -29,5 +29,6 @@ class RomanTest(unittest.TestCase):
for arabic, numeral in self.numerals.items():
self.assertEqual(numeral, roman_numerals.numeral(arabic))
if __name__ == '__main__':
unittest.main()

View File

@@ -33,5 +33,6 @@ class WordCountTests(unittest.TestCase):
def test_decode_unicode(self):
self.assertMultiLineEqual('⏰⚽⚽⚽⭐⭐⏰', decode('⏰3⚽2⭐⏰'))
if __name__ == '__main__':
unittest.main()

View File

@@ -65,5 +65,6 @@ class SayTest(unittest.TestCase):
"one hundred and twenty-three",
say(987654321123))
if __name__ == '__main__':
unittest.main()

View File

@@ -25,5 +25,6 @@ class WordTest(unittest.TestCase):
def test_scores_are_case_insensitive(self):
self.assertEqual(41, score("OxyphenButazone"))
if __name__ == '__main__':
unittest.main()

View File

@@ -29,5 +29,6 @@ class SieveTest(unittest.TestCase):
953, 967, 971, 977, 983, 991, 997]
self.assertEqual(expected, sieve(1000))
if __name__ == '__main__':
unittest.main()

View File

@@ -47,5 +47,6 @@ class SpaceAgeTest(unittest.TestCase):
self.assertEqual(260.16, age.on_earth())
self.assertEqual(1.58, age.on_neptune())
if __name__ == '__main__':
unittest.main()

View File

@@ -63,5 +63,6 @@ class TriangleTests(unittest.TestCase):
Triangle, 7, 3, 2
)
if __name__ == '__main__':
unittest.main()

View File

@@ -84,5 +84,6 @@ class WordCountTests(unittest.TestCase):
word_count('до🖖свидания!')
)
if __name__ == '__main__':
unittest.main()

View File

@@ -1,3 +1,3 @@
flake8>=3.0,<3.0.99
flake8>=3.2,<3.2.99
pep8>=1.7,<1.7.99
pyflakes>=1.3,<1.3.99