diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 8a6e5c410e..dbe5ffa174 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python uses: actions/setup-python@v2.2.1 with: - python-version: 3.7 + python-version: 3.8 - name: Download & Install dependencies run: | diff --git a/exercises/practice/acronym/acronym_test.py b/exercises/practice/acronym/acronym_test.py index 685cf30636..c5fbbfa39e 100644 --- a/exercises/practice/acronym/acronym_test.py +++ b/exercises/practice/acronym/acronym_test.py @@ -1,6 +1,8 @@ import unittest -from acronym import abbreviate +from acronym import ( + abbreviate, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/affine-cipher/affine_cipher_test.py b/exercises/practice/affine-cipher/affine_cipher_test.py index fe87d47a0c..4e9ca0b2b4 100644 --- a/exercises/practice/affine-cipher/affine_cipher_test.py +++ b/exercises/practice/affine-cipher/affine_cipher_test.py @@ -1,6 +1,9 @@ import unittest -from affine_cipher import decode, encode +from affine_cipher import ( + decode, + encode, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/all-your-base/all_your_base_test.py b/exercises/practice/all-your-base/all_your_base_test.py index 5779b928ac..a308261f40 100644 --- a/exercises/practice/all-your-base/all_your_base_test.py +++ b/exercises/practice/all-your-base/all_your_base_test.py @@ -1,6 +1,8 @@ import unittest -from all_your_base import rebase +from all_your_base import ( + rebase, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/allergies/allergies_test.py b/exercises/practice/allergies/allergies_test.py index bf1cd3bb1c..7529fc86ba 100644 --- a/exercises/practice/allergies/allergies_test.py +++ b/exercises/practice/allergies/allergies_test.py @@ -1,6 +1,8 @@ import unittest -from allergies import Allergies +from allergies import ( + Allergies, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/alphametics/alphametics_test.py b/exercises/practice/alphametics/alphametics_test.py index e9ec14a440..c1f573391b 100644 --- a/exercises/practice/alphametics/alphametics_test.py +++ b/exercises/practice/alphametics/alphametics_test.py @@ -1,6 +1,8 @@ import unittest -from alphametics import solve +from alphametics import ( + solve, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/anagram/anagram_test.py b/exercises/practice/anagram/anagram_test.py index 644182b6f6..241a6f4bfa 100644 --- a/exercises/practice/anagram/anagram_test.py +++ b/exercises/practice/anagram/anagram_test.py @@ -1,6 +1,8 @@ import unittest -from anagram import find_anagrams +from anagram import ( + find_anagrams, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/armstrong-numbers/armstrong_numbers_test.py b/exercises/practice/armstrong-numbers/armstrong_numbers_test.py index 01203b6976..a17beccae2 100644 --- a/exercises/practice/armstrong-numbers/armstrong_numbers_test.py +++ b/exercises/practice/armstrong-numbers/armstrong_numbers_test.py @@ -1,6 +1,8 @@ import unittest -from armstrong_numbers import is_armstrong_number +from armstrong_numbers import ( + is_armstrong_number, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/atbash-cipher/atbash_cipher_test.py b/exercises/practice/atbash-cipher/atbash_cipher_test.py index 237ff262e9..98c1072afc 100644 --- a/exercises/practice/atbash-cipher/atbash_cipher_test.py +++ b/exercises/practice/atbash-cipher/atbash_cipher_test.py @@ -1,6 +1,9 @@ import unittest -from atbash_cipher import decode, encode +from atbash_cipher import ( + decode, + encode, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/beer-song/beer_song_test.py b/exercises/practice/beer-song/beer_song_test.py index 606092d2e5..4952a374c8 100644 --- a/exercises/practice/beer-song/beer_song_test.py +++ b/exercises/practice/beer-song/beer_song_test.py @@ -1,6 +1,8 @@ import unittest -from beer_song import recite +from beer_song import ( + recite, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/binary-search-tree/binary_search_tree_test.py b/exercises/practice/binary-search-tree/binary_search_tree_test.py index de56ccf728..23c1fea73b 100644 --- a/exercises/practice/binary-search-tree/binary_search_tree_test.py +++ b/exercises/practice/binary-search-tree/binary_search_tree_test.py @@ -1,6 +1,9 @@ import unittest -from binary_search_tree import BinarySearchTree, TreeNode +from binary_search_tree import ( + BinarySearchTree, + TreeNode, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/binary-search/binary_search_test.py b/exercises/practice/binary-search/binary_search_test.py index 7e70550818..b2ef00cb0b 100644 --- a/exercises/practice/binary-search/binary_search_test.py +++ b/exercises/practice/binary-search/binary_search_test.py @@ -1,6 +1,8 @@ import unittest -from binary_search import find +from binary_search import ( + find, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/bob/bob_test.py b/exercises/practice/bob/bob_test.py index 94f85e6d0c..40081b045f 100644 --- a/exercises/practice/bob/bob_test.py +++ b/exercises/practice/bob/bob_test.py @@ -1,6 +1,8 @@ import unittest -from bob import response +from bob import ( + response, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/book-store/book_store_test.py b/exercises/practice/book-store/book_store_test.py index f7e0348b31..7680e24610 100644 --- a/exercises/practice/book-store/book_store_test.py +++ b/exercises/practice/book-store/book_store_test.py @@ -1,6 +1,8 @@ import unittest -from book_store import total +from book_store import ( + total, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -63,7 +65,7 @@ def test_three_each_of_first_2_books_and_2_each_of_remaining_books(self): self.assertEqual(total(basket), 7520) def test_four_groups_of_four_are_cheaper_than_two_groups_each_of_five_and_three( - self + self, ): basket = [1, 1, 2, 2, 3, 3, 4, 5, 1, 1, 2, 2, 3, 3, 4, 5] self.assertEqual(total(basket), 10240) diff --git a/exercises/practice/bowling/bowling_test.py b/exercises/practice/bowling/bowling_test.py index 00d2ff4245..971b8f71de 100644 --- a/exercises/practice/bowling/bowling_test.py +++ b/exercises/practice/bowling/bowling_test.py @@ -1,6 +1,8 @@ import unittest -from bowling import BowlingGame +from bowling import ( + BowlingGame, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -48,7 +50,7 @@ def test_a_strike_earns_ten_points_in_a_frame_with_a_single_roll(self): self.assertEqual(game.score(), 10) def test_points_scored_in_the_two_rolls_after_a_strike_are_counted_twice_as_a_bonus( - self + self, ): rolls = [10, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] game = self.roll_new_game(rolls) @@ -60,7 +62,7 @@ def test_consecutive_strikes_each_get_the_two_roll_bonus(self): self.assertEqual(game.score(), 81) def test_a_strike_in_the_last_frame_gets_a_two_roll_bonus_that_is_counted_once( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 7, 1] game = self.roll_new_game(rolls) @@ -77,7 +79,7 @@ def test_strikes_with_the_two_roll_bonus_do_not_get_bonus_rolls(self): self.assertEqual(game.score(), 30) def test_a_strike_with_the_one_roll_bonus_after_a_spare_in_the_last_frame_does_not_get_a_bonus( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3, 10] game = self.roll_new_game(rolls) @@ -107,7 +109,7 @@ def test_two_rolls_in_a_frame_cannot_score_more_than_10_points(self): game.roll(6) def test_bonus_roll_after_a_strike_in_the_last_frame_cannot_score_more_than_10_points( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10] game = self.roll_new_game(rolls) @@ -115,7 +117,7 @@ def test_bonus_roll_after_a_strike_in_the_last_frame_cannot_score_more_than_10_p game.roll(11) def test_two_bonus_rolls_after_a_strike_in_the_last_frame_cannot_score_more_than_10_points( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 5] game = self.roll_new_game(rolls) @@ -123,14 +125,14 @@ def test_two_bonus_rolls_after_a_strike_in_the_last_frame_cannot_score_more_than game.roll(6) def test_two_bonus_rolls_after_a_strike_in_the_last_frame_can_score_more_than_10_points_if_one_is_a_strike( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 6] game = self.roll_new_game(rolls) self.assertEqual(game.score(), 26) def test_the_second_bonus_rolls_after_a_strike_in_the_last_frame_cannot_be_a_strike_if_the_first_one_is_not_a_strike( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 6] game = self.roll_new_game(rolls) @@ -138,7 +140,7 @@ def test_the_second_bonus_rolls_after_a_strike_in_the_last_frame_cannot_be_a_str game.roll(10) def test_second_bonus_roll_after_a_strike_in_the_last_frame_cannot_score_more_than_10_points( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10] game = self.roll_new_game(rolls) @@ -164,7 +166,7 @@ def test_cannot_roll_if_game_already_has_ten_frames(self): game.roll(0) def test_bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_can_be_calculated( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10] game = self.roll_new_game(rolls) @@ -172,7 +174,7 @@ def test_bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_ game.roll() def test_both_bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_score_can_be_calculated( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10] game = self.roll_new_game(rolls) @@ -180,7 +182,7 @@ def test_both_bonus_rolls_for_a_strike_in_the_last_frame_must_be_rolled_before_s game.roll() def test_bonus_roll_for_a_spare_in_the_last_frame_must_be_rolled_before_score_can_be_calculated( - self + self, ): rolls = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 3] game = self.roll_new_game(rolls) diff --git a/exercises/practice/change/change_test.py b/exercises/practice/change/change_test.py index 26fa08faa8..313fb019fa 100644 --- a/exercises/practice/change/change_test.py +++ b/exercises/practice/change/change_test.py @@ -1,6 +1,8 @@ import unittest -from change import find_fewest_coins +from change import ( + find_fewest_coins, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/circular-buffer/circular_buffer_test.py b/exercises/practice/circular-buffer/circular_buffer_test.py index d3db1071db..3d8353a7e1 100644 --- a/exercises/practice/circular-buffer/circular_buffer_test.py +++ b/exercises/practice/circular-buffer/circular_buffer_test.py @@ -1,6 +1,8 @@ import unittest -from circular_buffer import CircularBuffer +from circular_buffer import ( + CircularBuffer, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -88,7 +90,7 @@ def test_overwrite_replaces_the_oldest_item_on_full_buffer(self): self.assertEqual(buf.read(), "3") def test_overwrite_replaces_the_oldest_item_remaining_in_buffer_following_a_read( - self + self, ): buf = CircularBuffer(3) buf.write("1") diff --git a/exercises/practice/clock/clock_test.py b/exercises/practice/clock/clock_test.py index 0c3c3dd46f..f73af0947b 100644 --- a/exercises/practice/clock/clock_test.py +++ b/exercises/practice/clock/clock_test.py @@ -1,6 +1,8 @@ import unittest -from clock import Clock +from clock import ( + Clock, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/collatz-conjecture/collatz_conjecture_test.py b/exercises/practice/collatz-conjecture/collatz_conjecture_test.py index feaea42c14..b76952a050 100644 --- a/exercises/practice/collatz-conjecture/collatz_conjecture_test.py +++ b/exercises/practice/collatz-conjecture/collatz_conjecture_test.py @@ -1,6 +1,8 @@ import unittest -from collatz_conjecture import steps +from collatz_conjecture import ( + steps, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/complex-numbers/complex_numbers_test.py b/exercises/practice/complex-numbers/complex_numbers_test.py index b992865cce..e0acc7661f 100644 --- a/exercises/practice/complex-numbers/complex_numbers_test.py +++ b/exercises/practice/complex-numbers/complex_numbers_test.py @@ -3,7 +3,9 @@ import unittest -from complex_numbers import ComplexNumber +from complex_numbers import ( + ComplexNumber, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -108,12 +110,12 @@ def test_absolute_value_of_a_negative_purely_real_number(self): self.assertEqual(abs(ComplexNumber(-5, 0)), 5) def test_absolute_value_of_a_purely_imaginary_number_with_positive_imaginary_part( - self + self, ): self.assertEqual(abs(ComplexNumber(0, 5)), 5) def test_absolute_value_of_a_purely_imaginary_number_with_negative_imaginary_part( - self + self, ): self.assertEqual(abs(ComplexNumber(0, -5)), 5) diff --git a/exercises/practice/connect/connect_test.py b/exercises/practice/connect/connect_test.py index 375859ae4d..17c786c865 100644 --- a/exercises/practice/connect/connect_test.py +++ b/exercises/practice/connect/connect_test.py @@ -1,6 +1,8 @@ import unittest -from connect import ConnectGame +from connect import ( + ConnectGame, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/crypto-square/crypto_square_test.py b/exercises/practice/crypto-square/crypto_square_test.py index f53bdacd3c..4829f90565 100644 --- a/exercises/practice/crypto-square/crypto_square_test.py +++ b/exercises/practice/crypto-square/crypto_square_test.py @@ -1,6 +1,8 @@ import unittest -from crypto_square import cipher_text +from crypto_square import ( + cipher_text, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -32,14 +34,14 @@ def test_9_character_plaintext_results_in_3_chunks_of_3_characters(self): self.assertEqual(cipher_text(value), expected) def test_8_character_plaintext_results_in_3_chunks_the_last_one_with_a_trailing_space( - self + self, ): value = "Chill out." expected = "clu hlt io " self.assertEqual(cipher_text(value), expected) def test_54_character_plaintext_results_in_7_chunks_the_last_two_with_trailing_spaces( - self + self, ): value = "If man was meant to stay on the ground, god would have given us roots." expected = "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau " diff --git a/exercises/practice/custom-set/custom_set_test.py b/exercises/practice/custom-set/custom_set_test.py index d54fd0cd81..e5e3ffd3bc 100644 --- a/exercises/practice/custom-set/custom_set_test.py +++ b/exercises/practice/custom-set/custom_set_test.py @@ -1,6 +1,8 @@ import unittest -from custom_set import CustomSet +from custom_set import ( + CustomSet, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -154,7 +156,7 @@ def test_intersection_of_two_sets_with_no_shared_elements_is_an_empty_set(self): self.assertEqual(set1.intersection(set2), expected) def test_intersection_of_two_sets_with_shared_elements_is_a_set_of_the_shared_elements( - self + self, ): set1 = CustomSet([1, 2, 3, 4]) set2 = CustomSet([3, 2, 5]) @@ -180,7 +182,7 @@ def test_difference_of_a_non_empty_set_and_an_empty_set_is_the_non_empty_set(sel self.assertEqual(set1 - set2, expected) def test_difference_of_two_non_empty_sets_is_a_set_of_elements_that_are_only_in_the_first_set( - self + self, ): set1 = CustomSet([3, 2, 1]) set2 = CustomSet([2, 4]) diff --git a/exercises/practice/darts/darts_test.py b/exercises/practice/darts/darts_test.py index c479afd128..c720e5a787 100644 --- a/exercises/practice/darts/darts_test.py +++ b/exercises/practice/darts/darts_test.py @@ -1,6 +1,8 @@ import unittest -from darts import score +from darts import ( + score, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/diamond/diamond_test.py b/exercises/practice/diamond/diamond_test.py index c82eb94945..f0e60c862d 100644 --- a/exercises/practice/diamond/diamond_test.py +++ b/exercises/practice/diamond/diamond_test.py @@ -1,6 +1,8 @@ import unittest -from diamond import rows +from diamond import ( + rows, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/difference-of-squares/difference_of_squares_test.py b/exercises/practice/difference-of-squares/difference_of_squares_test.py index c634cea238..8c2069e4d9 100644 --- a/exercises/practice/difference-of-squares/difference_of_squares_test.py +++ b/exercises/practice/difference-of-squares/difference_of_squares_test.py @@ -1,6 +1,10 @@ import unittest -from difference_of_squares import difference_of_squares, square_of_sum, sum_of_squares +from difference_of_squares import ( + difference_of_squares, + square_of_sum, + sum_of_squares, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/diffie-hellman/diffie_hellman_test.py b/exercises/practice/diffie-hellman/diffie_hellman_test.py index a56df30c69..975c57f9b1 100644 --- a/exercises/practice/diffie-hellman/diffie_hellman_test.py +++ b/exercises/practice/diffie-hellman/diffie_hellman_test.py @@ -1,6 +1,10 @@ import unittest -from diffie_hellman import private_key, public_key, secret +from diffie_hellman import ( + private_key, + public_key, + secret, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -24,13 +28,27 @@ def test_can_calculate_public_key_using_private_key(self): p = 23 g = 5 private_key = 6 - self.assertEqual(8, public_key(p, g, private_key)) + self.assertEqual( + 8, + public_key( + p, + g, + private_key, + ), + ) def test_can_calculate_secret_using_other_party_s_public_key(self): p = 23 their_public_key = 19 my_private_key = 6 - self.assertEqual(2, secret(p, their_public_key, my_private_key)) + self.assertEqual( + 2, + secret( + p, + their_public_key, + my_private_key, + ), + ) def test_key_exchange(self): p = 23 diff --git a/exercises/practice/dnd-character/dnd_character_test.py b/exercises/practice/dnd-character/dnd_character_test.py index 01424a92b3..b3a93e5759 100644 --- a/exercises/practice/dnd-character/dnd_character_test.py +++ b/exercises/practice/dnd-character/dnd_character_test.py @@ -1,6 +1,9 @@ import unittest -from dnd_character import Character, modifier +from dnd_character import ( + Character, + modifier, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/dominoes/dominoes_test.py b/exercises/practice/dominoes/dominoes_test.py index a4b5cbffb9..3f0b289908 100644 --- a/exercises/practice/dominoes/dominoes_test.py +++ b/exercises/practice/dominoes/dominoes_test.py @@ -1,6 +1,8 @@ import unittest -from dominoes import can_chain +from dominoes import ( + can_chain, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/etl/etl_test.py b/exercises/practice/etl/etl_test.py index 5f8a2af8ea..693ecb9e86 100644 --- a/exercises/practice/etl/etl_test.py +++ b/exercises/practice/etl/etl_test.py @@ -1,6 +1,8 @@ import unittest -from etl import transform +from etl import ( + transform, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/flatten-array/flatten_array_test.py b/exercises/practice/flatten-array/flatten_array_test.py index 3cfb57f23f..269b0ba94c 100644 --- a/exercises/practice/flatten-array/flatten_array_test.py +++ b/exercises/practice/flatten-array/flatten_array_test.py @@ -1,6 +1,8 @@ import unittest -from flatten_array import flatten +from flatten_array import ( + flatten, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/food-chain/food_chain_test.py b/exercises/practice/food-chain/food_chain_test.py index 435d7a1e85..d77953527e 100644 --- a/exercises/practice/food-chain/food_chain_test.py +++ b/exercises/practice/food-chain/food_chain_test.py @@ -1,6 +1,8 @@ import unittest -from food_chain import recite +from food_chain import ( + recite, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/forth/forth_test.py b/exercises/practice/forth/forth_test.py index a6a2b499b9..737956b404 100644 --- a/exercises/practice/forth/forth_test.py +++ b/exercises/practice/forth/forth_test.py @@ -1,6 +1,9 @@ import unittest -from forth import evaluate, StackUnderflowError +from forth import ( + evaluate, + StackUnderflowError, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/gigasecond/gigasecond_test.py b/exercises/practice/gigasecond/gigasecond_test.py index c787bae04c..76ff16a64c 100644 --- a/exercises/practice/gigasecond/gigasecond_test.py +++ b/exercises/practice/gigasecond/gigasecond_test.py @@ -1,7 +1,9 @@ from datetime import datetime import unittest -from gigasecond import add +from gigasecond import ( + add, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/go-counting/go_counting_test.py b/exercises/practice/go-counting/go_counting_test.py index 44b9a099f1..60c97cc414 100644 --- a/exercises/practice/go-counting/go_counting_test.py +++ b/exercises/practice/go-counting/go_counting_test.py @@ -1,6 +1,11 @@ import unittest -from go_counting import Board, WHITE, BLACK, NONE +from go_counting import ( + Board, + WHITE, + BLACK, + NONE, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/grade-school/grade_school_test.py b/exercises/practice/grade-school/grade_school_test.py index 02642a52ff..2670800176 100644 --- a/exercises/practice/grade-school/grade_school_test.py +++ b/exercises/practice/grade-school/grade_school_test.py @@ -1,6 +1,8 @@ import unittest -from grade_school import School +from grade_school import ( + School, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -12,7 +14,7 @@ def test_adding_a_student_adds_them_to_the_sorted_roster(self): expected = ["Aimee"] self.assertEqual(school.roster(), expected) - def test_adding_more_student_adds_them_to_the_sorted_roster(self): + def test_adding_more_students_adds_them_to_the_sorted_roster(self): school = School() school.add_student(name="Blair", grade=2) school.add_student(name="James", grade=2) @@ -21,7 +23,7 @@ def test_adding_more_student_adds_them_to_the_sorted_roster(self): self.assertEqual(school.roster(), expected) def test_adding_students_to_different_grades_adds_them_to_the_same_sorted_roster( - self + self, ): school = School() school.add_student(name="Chelsea", grade=3) diff --git a/exercises/practice/grains/grains_test.py b/exercises/practice/grains/grains_test.py index de4e8de8e4..ed528501ed 100644 --- a/exercises/practice/grains/grains_test.py +++ b/exercises/practice/grains/grains_test.py @@ -1,30 +1,33 @@ import unittest -from grains import square, total +from grains import ( + square, + total, +) # Tests adapted from `problem-specifications//canonical-data.json` class GrainsTest(unittest.TestCase): - def test_1(self): + def test_grains_on_square_1(self): self.assertEqual(square(1), 1) - def test_2(self): + def test_grains_on_square_2(self): self.assertEqual(square(2), 2) - def test_3(self): + def test_grains_on_square_3(self): self.assertEqual(square(3), 4) - def test_4(self): + def test_grains_on_square_4(self): self.assertEqual(square(4), 8) - def test_16(self): + def test_grains_on_square_16(self): self.assertEqual(square(16), 32768) - def test_32(self): + def test_grains_on_square_32(self): self.assertEqual(square(32), 2147483648) - def test_64(self): + def test_grains_on_square_64(self): self.assertEqual(square(64), 9223372036854775808) def test_square_0_raises_an_exception(self): diff --git a/exercises/practice/grep/grep_test.py b/exercises/practice/grep/grep_test.py index 4dea70e202..804071542d 100644 --- a/exercises/practice/grep/grep_test.py +++ b/exercises/practice/grep/grep_test.py @@ -1,6 +1,8 @@ import unittest -from grep import grep +from grep import ( + grep, +) # Tests adapted from `problem-specifications//canonical-data.json` import io diff --git a/exercises/practice/hamming/hamming_test.py b/exercises/practice/hamming/hamming_test.py index 555d9e9895..885ae0a88e 100644 --- a/exercises/practice/hamming/hamming_test.py +++ b/exercises/practice/hamming/hamming_test.py @@ -1,6 +1,8 @@ import unittest -from hamming import distance +from hamming import ( + distance, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/hello-world/hello_world_test.py b/exercises/practice/hello-world/hello_world_test.py index 82dc88ef3c..39c9612482 100644 --- a/exercises/practice/hello-world/hello_world_test.py +++ b/exercises/practice/hello-world/hello_world_test.py @@ -1,6 +1,8 @@ import unittest -from hello_world import hello +from hello_world import ( + hello, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/high-scores/high_scores_test.py b/exercises/practice/high-scores/high_scores_test.py index be0ad6e8be..04b788a1b2 100644 --- a/exercises/practice/high-scores/high_scores_test.py +++ b/exercises/practice/high-scores/high_scores_test.py @@ -1,6 +1,10 @@ import unittest -from high_scores import latest, personal_best, personal_top_three +from high_scores import ( + latest, + personal_best, + personal_top_three, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/house/house_test.py b/exercises/practice/house/house_test.py index 60e1b39b8a..0facef614f 100644 --- a/exercises/practice/house/house_test.py +++ b/exercises/practice/house/house_test.py @@ -1,6 +1,8 @@ import unittest -from house import recite +from house import ( + recite, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/isbn-verifier/isbn_verifier_test.py b/exercises/practice/isbn-verifier/isbn_verifier_test.py index ece22ce06c..7b8a5324ca 100644 --- a/exercises/practice/isbn-verifier/isbn_verifier_test.py +++ b/exercises/practice/isbn-verifier/isbn_verifier_test.py @@ -1,6 +1,8 @@ import unittest -from isbn_verifier import is_valid +from isbn_verifier import ( + is_valid, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/isogram/isogram_test.py b/exercises/practice/isogram/isogram_test.py index 013e9b8923..11aca026cc 100644 --- a/exercises/practice/isogram/isogram_test.py +++ b/exercises/practice/isogram/isogram_test.py @@ -1,6 +1,8 @@ import unittest -from isogram import is_isogram +from isogram import ( + is_isogram, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/kindergarten-garden/kindergarten_garden_test.py b/exercises/practice/kindergarten-garden/kindergarten_garden_test.py index 7f6325c953..6b4ba3580e 100644 --- a/exercises/practice/kindergarten-garden/kindergarten_garden_test.py +++ b/exercises/practice/kindergarten-garden/kindergarten_garden_test.py @@ -1,6 +1,8 @@ import unittest -from kindergarten_garden import Garden +from kindergarten_garden import ( + Garden, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -32,23 +34,23 @@ def test_partial_garden_third_student_s_garden(self): garden = Garden("VVCCGG\nVVCCGG") self.assertEqual(garden.plants("Charlie"), ["Grass", "Grass", "Grass", "Grass"]) - def test_full_garden_first_student_s_garden(self): + def test_full_garden_for_alice_first_student_s_garden(self): garden = Garden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") self.assertEqual( garden.plants("Alice"), ["Violets", "Radishes", "Violets", "Radishes"] ) - def test_full_garden_second_student_s_garden(self): + def test_full_garden_for_bob_second_student_s_garden(self): garden = Garden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") self.assertEqual(garden.plants("Bob"), ["Clover", "Grass", "Clover", "Clover"]) - def test_full_garden_second_to_last_student_s_garden(self): + def test_full_garden_for_kincaid_second_to_last_student_s_garden(self): garden = Garden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") self.assertEqual( garden.plants("Kincaid"), ["Grass", "Clover", "Clover", "Grass"] ) - def test_full_garden_last_student_s_garden(self): + def test_full_garden_for_larry_last_student_s_garden(self): garden = Garden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV") self.assertEqual( garden.plants("Larry"), ["Grass", "Violets", "Clover", "Violets"] diff --git a/exercises/practice/knapsack/knapsack_test.py b/exercises/practice/knapsack/knapsack_test.py index bfb75c38d7..0a792f179c 100644 --- a/exercises/practice/knapsack/knapsack_test.py +++ b/exercises/practice/knapsack/knapsack_test.py @@ -1,6 +1,8 @@ import unittest -from knapsack import maximum_value +from knapsack import ( + maximum_value, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/largest-series-product/largest_series_product_test.py b/exercises/practice/largest-series-product/largest_series_product_test.py index 3b0e511f25..ddb91e6def 100644 --- a/exercises/practice/largest-series-product/largest_series_product_test.py +++ b/exercises/practice/largest-series-product/largest_series_product_test.py @@ -1,6 +1,8 @@ import unittest -from largest_series_product import largest_product +from largest_series_product import ( + largest_product, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/leap/leap_test.py b/exercises/practice/leap/leap_test.py index 3db4e247d3..e51aeb423a 100644 --- a/exercises/practice/leap/leap_test.py +++ b/exercises/practice/leap/leap_test.py @@ -1,6 +1,8 @@ import unittest -from leap import leap_year +from leap import ( + leap_year, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -24,7 +26,7 @@ def test_year_divisible_by_100_not_divisible_by_400_in_common_year(self): def test_year_divisible_by_100_but_not_by_3_is_still_not_a_leap_year(self): self.assertIs(leap_year(1900), False) - def test_year_divisible_by_400_in_leap_year(self): + def test_year_divisible_by_400_is_leap_year(self): self.assertIs(leap_year(2000), True) def test_year_divisible_by_400_but_not_by_125_is_still_a_leap_year(self): diff --git a/exercises/practice/luhn/luhn_test.py b/exercises/practice/luhn/luhn_test.py index e22f851798..b0ee748fce 100644 --- a/exercises/practice/luhn/luhn_test.py +++ b/exercises/practice/luhn/luhn_test.py @@ -1,6 +1,8 @@ import unittest -from luhn import Luhn +from luhn import ( + Luhn, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/markdown/markdown_test.py b/exercises/practice/markdown/markdown_test.py index 2f3678133c..5f18a6ba6a 100644 --- a/exercises/practice/markdown/markdown_test.py +++ b/exercises/practice/markdown/markdown_test.py @@ -1,6 +1,8 @@ import unittest -from markdown import parse +from markdown import ( + parse, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -50,7 +52,7 @@ def test_with_a_little_bit_of_everything(self): ) def test_with_markdown_symbols_in_the_header_text_that_should_not_be_interpreted( - self + self, ): self.assertEqual( parse("# This is a header with # and * in the text"), @@ -58,7 +60,7 @@ def test_with_markdown_symbols_in_the_header_text_that_should_not_be_interpreted ) def test_with_markdown_symbols_in_the_list_item_text_that_should_not_be_interpreted( - self + self, ): self.assertEqual( parse("* Item 1 with a # in the text\n* Item 2 with * in the text"), @@ -66,7 +68,7 @@ def test_with_markdown_symbols_in_the_list_item_text_that_should_not_be_interpre ) def test_with_markdown_symbols_in_the_paragraph_text_that_should_not_be_interpreted( - self + self, ): self.assertEqual( parse("This is a paragraph with # and * in the text"), diff --git a/exercises/practice/matching-brackets/matching_brackets_test.py b/exercises/practice/matching-brackets/matching_brackets_test.py index dd3304dd67..e4330bfd9d 100644 --- a/exercises/practice/matching-brackets/matching_brackets_test.py +++ b/exercises/practice/matching-brackets/matching_brackets_test.py @@ -1,6 +1,8 @@ import unittest -from matching_brackets import is_paired +from matching_brackets import ( + is_paired, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/matrix/matrix_test.py b/exercises/practice/matrix/matrix_test.py index 9176dd9af0..10820ab6c1 100644 --- a/exercises/practice/matrix/matrix_test.py +++ b/exercises/practice/matrix/matrix_test.py @@ -1,6 +1,8 @@ import unittest -from matrix import Matrix +from matrix import ( + Matrix, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/meetup/meetup_test.py b/exercises/practice/meetup/meetup_test.py index 029f1e959a..7b4d6d2915 100644 --- a/exercises/practice/meetup/meetup_test.py +++ b/exercises/practice/meetup/meetup_test.py @@ -1,7 +1,10 @@ from datetime import date import unittest -from meetup import meetup, MeetupDayException +from meetup import ( + meetup, + MeetupDayException, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/minesweeper/minesweeper_test.py b/exercises/practice/minesweeper/minesweeper_test.py index c063ac93e4..3da8ef1557 100644 --- a/exercises/practice/minesweeper/minesweeper_test.py +++ b/exercises/practice/minesweeper/minesweeper_test.py @@ -1,6 +1,8 @@ import unittest -from minesweeper import annotate +from minesweeper import ( + annotate, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/nth-prime/nth_prime_test.py b/exercises/practice/nth-prime/nth_prime_test.py index d2086b7c43..f928e3d2bc 100644 --- a/exercises/practice/nth-prime/nth_prime_test.py +++ b/exercises/practice/nth-prime/nth_prime_test.py @@ -1,6 +1,8 @@ import unittest -from nth_prime import prime +from nth_prime import ( + prime, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/ocr-numbers/ocr_numbers_test.py b/exercises/practice/ocr-numbers/ocr_numbers_test.py index f38f0fb19b..dad28aee62 100644 --- a/exercises/practice/ocr-numbers/ocr_numbers_test.py +++ b/exercises/practice/ocr-numbers/ocr_numbers_test.py @@ -1,6 +1,8 @@ import unittest -from ocr_numbers import convert +from ocr_numbers import ( + convert, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -16,13 +18,13 @@ def test_unreadable_but_correctly_sized_inputs_return(self): self.assertEqual(convert([" ", " _", " |", " "]), "?") def test_input_with_a_number_of_lines_that_is_not_a_multiple_of_four_raises_an_error( - self + self, ): with self.assertRaisesWithMessage(ValueError): convert([" _ ", "| |", " "]) def test_input_with_a_number_of_columns_that_is_not_a_multiple_of_three_raises_an_error( - self + self, ): with self.assertRaisesWithMessage(ValueError): convert([" ", " |", " |", " "]) @@ -91,7 +93,7 @@ def test_recognizes_string_of_decimal_numbers(self): ) def test_numbers_separated_by_empty_lines_are_recognized_lines_are_joined_by_commas( - self + self, ): self.assertEqual( convert( diff --git a/exercises/practice/palindrome-products/palindrome_products_test.py b/exercises/practice/palindrome-products/palindrome_products_test.py index 4e7ddcc17b..f88e8ee66f 100644 --- a/exercises/practice/palindrome-products/palindrome_products_test.py +++ b/exercises/practice/palindrome-products/palindrome_products_test.py @@ -1,6 +1,9 @@ import unittest -from palindrome_products import largest, smallest +from palindrome_products import ( + largest, + smallest, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/pangram/pangram_test.py b/exercises/practice/pangram/pangram_test.py index 034d5dd769..36c61adb95 100644 --- a/exercises/practice/pangram/pangram_test.py +++ b/exercises/practice/pangram/pangram_test.py @@ -1,6 +1,8 @@ import unittest -from pangram import is_pangram +from pangram import ( + is_pangram, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/perfect-numbers/perfect_numbers_test.py b/exercises/practice/perfect-numbers/perfect_numbers_test.py index 0bf7dbfa5d..9139a44a9e 100644 --- a/exercises/practice/perfect-numbers/perfect_numbers_test.py +++ b/exercises/practice/perfect-numbers/perfect_numbers_test.py @@ -1,6 +1,8 @@ import unittest -from perfect_numbers import classify +from perfect_numbers import ( + classify, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/phone-number/phone_number_test.py b/exercises/practice/phone-number/phone_number_test.py index 71ff522376..8fb616e390 100644 --- a/exercises/practice/phone-number/phone_number_test.py +++ b/exercises/practice/phone-number/phone_number_test.py @@ -1,6 +1,8 @@ import unittest -from phone_number import PhoneNumber +from phone_number import ( + PhoneNumber, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/pig-latin/pig_latin_test.py b/exercises/practice/pig-latin/pig_latin_test.py index 2cef287d1a..cf666ddf3a 100644 --- a/exercises/practice/pig-latin/pig_latin_test.py +++ b/exercises/practice/pig-latin/pig_latin_test.py @@ -1,6 +1,8 @@ import unittest -from pig_latin import translate +from pig_latin import ( + translate, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/poker/poker_test.py b/exercises/practice/poker/poker_test.py index 8b97906d8a..8aee2d61fe 100644 --- a/exercises/practice/poker/poker_test.py +++ b/exercises/practice/poker/poker_test.py @@ -1,6 +1,8 @@ import unittest -from poker import best_hands +from poker import ( + best_hands, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -29,7 +31,7 @@ def test_a_tie_has_multiple_winners(self): ) def test_multiple_hands_with_the_same_high_cards_tie_compares_next_highest_ranked_down_to_last_card( - self + self, ): self.assertEqual( best_hands(["3S 5H 6S 8D 7H", "2S 5D 6D 8C 7S"]), ["3S 5H 6S 8D 7H"] @@ -56,14 +58,14 @@ def test_both_hands_have_two_pairs_highest_ranked_pair_wins(self): ) def test_both_hands_have_two_pairs_with_the_same_highest_ranked_pair_tie_goes_to_low_pair( - self + self, ): self.assertEqual( best_hands(["2S QS 2C QD JH", "JD QH JS 8D QC"]), ["JD QH JS 8D QC"] ) def test_both_hands_have_two_identically_ranked_pairs_tie_goes_to_remaining_card_kicker( - self + self, ): self.assertEqual( best_hands(["JD QH JS 8D QC", "JS QS JC 2D QD"]), ["JD QH JS 8D QC"] @@ -80,7 +82,7 @@ def test_both_hands_have_three_of_a_kind_tie_goes_to_highest_ranked_triplet(self ) def test_with_multiple_decks_two_players_can_have_same_three_of_a_kind_ties_go_to_highest_remaining_cards( - self + self, ): self.assertEqual( best_hands(["4S AH AS 7C AD", "4S AH AS 8C AD"]), ["4S AH AS 8C AD"] @@ -107,7 +109,7 @@ def test_both_hands_with_a_straight_tie_goes_to_highest_ranked_card(self): ) def test_even_though_an_ace_is_usually_high_a_5_high_straight_is_the_lowest_scoring_straight( - self + self, ): self.assertEqual( best_hands(["2H 3C 4D 5D 6H", "4S AH 3S 2D 5H"]), ["2H 3C 4D 5D 6H"] @@ -119,7 +121,7 @@ def test_flush_beats_a_straight(self): ) def test_both_hands_have_a_flush_tie_goes_to_high_card_down_to_the_last_one_if_necessary( - self + self, ): self.assertEqual( best_hands(["4H 7H 8H 9H 6H", "2S 4S 5S 6S 7S"]), ["4H 7H 8H 9H 6H"] @@ -136,7 +138,7 @@ def test_both_hands_have_a_full_house_tie_goes_to_highest_ranked_triplet(self): ) def test_with_multiple_decks_both_hands_have_a_full_house_with_the_same_triplet_tie_goes_to_the_pair( - self + self, ): self.assertEqual( best_hands(["5H 5S 5D 9S 9D", "5H 5S 5D 8S 8D"]), ["5H 5S 5D 9S 9D"] @@ -153,7 +155,7 @@ def test_both_hands_have_four_of_a_kind_tie_goes_to_high_quad(self): ) def test_with_multiple_decks_both_hands_with_identical_four_of_a_kind_tie_determined_by_kicker( - self + self, ): self.assertEqual( best_hands(["3S 3H 2S 3D 3C", "3S 3H 4S 3D 3C"]), ["3S 3H 4S 3D 3C"] diff --git a/exercises/practice/pov/pov_test.py b/exercises/practice/pov/pov_test.py index 5e93076b8d..5d8832e287 100644 --- a/exercises/practice/pov/pov_test.py +++ b/exercises/practice/pov/pov_test.py @@ -1,6 +1,8 @@ import unittest -from pov import Tree +from pov import ( + Tree, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/prime-factors/prime_factors_test.py b/exercises/practice/prime-factors/prime_factors_test.py index 4995460aff..80deb17caa 100644 --- a/exercises/practice/prime-factors/prime_factors_test.py +++ b/exercises/practice/prime-factors/prime_factors_test.py @@ -1,6 +1,8 @@ import unittest -from prime_factors import factors +from prime_factors import ( + factors, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/protein-translation/protein_translation_test.py b/exercises/practice/protein-translation/protein_translation_test.py index ede1822502..32ed73774c 100644 --- a/exercises/practice/protein-translation/protein_translation_test.py +++ b/exercises/practice/protein-translation/protein_translation_test.py @@ -1,6 +1,8 @@ import unittest -from protein_translation import proteins +from protein_translation import ( + proteins, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/pythagorean-triplet/pythagorean_triplet_test.py b/exercises/practice/pythagorean-triplet/pythagorean_triplet_test.py index 6ea67f25d0..70d501c4fb 100644 --- a/exercises/practice/pythagorean-triplet/pythagorean_triplet_test.py +++ b/exercises/practice/pythagorean-triplet/pythagorean_triplet_test.py @@ -1,6 +1,8 @@ import unittest -from pythagorean_triplet import triplets_with_sum +from pythagorean_triplet import ( + triplets_with_sum, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/queen-attack/queen_attack_test.py b/exercises/practice/queen-attack/queen_attack_test.py index 612fe2f6d4..8f9438dc67 100644 --- a/exercises/practice/queen-attack/queen_attack_test.py +++ b/exercises/practice/queen-attack/queen_attack_test.py @@ -1,6 +1,8 @@ import unittest -from queen_attack import Queen +from queen_attack import ( + Queen, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -27,7 +29,7 @@ def test_queen_must_have_column_on_board(self): Queen(4, 8) # Test the ability of one queen to attack another - def test_can_not_attack(self): + def test_cannot_attack(self): self.assertIs(Queen(2, 4).can_attack(Queen(6, 6)), False) def test_can_attack_on_same_row(self): diff --git a/exercises/practice/rail-fence-cipher/rail_fence_cipher_test.py b/exercises/practice/rail-fence-cipher/rail_fence_cipher_test.py index fc57b79293..65743180a7 100644 --- a/exercises/practice/rail-fence-cipher/rail_fence_cipher_test.py +++ b/exercises/practice/rail-fence-cipher/rail_fence_cipher_test.py @@ -1,6 +1,9 @@ import unittest -from rail_fence_cipher import decode, encode +from rail_fence_cipher import ( + decode, + encode, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/raindrops/raindrops_test.py b/exercises/practice/raindrops/raindrops_test.py index 8ac1a43d03..247f4daa47 100644 --- a/exercises/practice/raindrops/raindrops_test.py +++ b/exercises/practice/raindrops/raindrops_test.py @@ -1,6 +1,8 @@ import unittest -from raindrops import convert +from raindrops import ( + convert, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -22,7 +24,7 @@ def test_the_sound_for_6_is_pling_as_it_has_a_factor_3(self): self.assertEqual(convert(6), "Pling") def test_2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base( - self + self, ): self.assertEqual(convert(8), "8") diff --git a/exercises/practice/rational-numbers/rational_numbers_test.py b/exercises/practice/rational-numbers/rational_numbers_test.py index e83ac11e3d..b7c67178ee 100644 --- a/exercises/practice/rational-numbers/rational_numbers_test.py +++ b/exercises/practice/rational-numbers/rational_numbers_test.py @@ -1,7 +1,9 @@ from __future__ import division import unittest -from rational_numbers import Rational +from rational_numbers import ( + Rational, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -78,7 +80,7 @@ def test_absolute_value_of_a_positive_rational_number(self): self.assertEqual(abs(Rational(1, 2)), Rational(1, 2)) def test_absolute_value_of_a_positive_rational_number_with_negative_numerator_and_denominator( - self + self, ): self.assertEqual(abs(Rational(-1, -2)), Rational(1, 2)) @@ -86,7 +88,7 @@ def test_absolute_value_of_a_negative_rational_number(self): self.assertEqual(abs(Rational(-1, 2)), Rational(1, 2)) def test_absolute_value_of_a_negative_rational_number_with_negative_denominator( - self + self, ): self.assertEqual(abs(Rational(1, -2)), Rational(1, 2)) diff --git a/exercises/practice/rectangles/rectangles_test.py b/exercises/practice/rectangles/rectangles_test.py index 534f1beb2c..3cfa8181cf 100644 --- a/exercises/practice/rectangles/rectangles_test.py +++ b/exercises/practice/rectangles/rectangles_test.py @@ -1,6 +1,8 @@ import unittest -from rectangles import rectangles +from rectangles import ( + rectangles, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/resistor-color-duo/resistor_color_duo_test.py b/exercises/practice/resistor-color-duo/resistor_color_duo_test.py index 9b212c9f0c..c259f5db79 100644 --- a/exercises/practice/resistor-color-duo/resistor_color_duo_test.py +++ b/exercises/practice/resistor-color-duo/resistor_color_duo_test.py @@ -1,6 +1,8 @@ import unittest -from resistor_color_duo import value +from resistor_color_duo import ( + value, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/resistor-color/resistor_color_test.py b/exercises/practice/resistor-color/resistor_color_test.py index 96e4f6c938..62ab48625f 100644 --- a/exercises/practice/resistor-color/resistor_color_test.py +++ b/exercises/practice/resistor-color/resistor_color_test.py @@ -1,6 +1,9 @@ import unittest -from resistor_color import color_code, colors +from resistor_color import ( + color_code, + colors, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/rest-api/rest_api_test.py b/exercises/practice/rest-api/rest_api_test.py index 5f53049bf4..8092aec237 100644 --- a/exercises/practice/rest-api/rest_api_test.py +++ b/exercises/practice/rest-api/rest_api_test.py @@ -1,6 +1,8 @@ import unittest -from rest_api import RestAPI +from rest_api import ( + RestAPI, +) # Tests adapted from `problem-specifications//canonical-data.json` import json diff --git a/exercises/practice/reverse-string/reverse_string_test.py b/exercises/practice/reverse-string/reverse_string_test.py index 18724a0ae3..78212b41de 100644 --- a/exercises/practice/reverse-string/reverse_string_test.py +++ b/exercises/practice/reverse-string/reverse_string_test.py @@ -1,6 +1,8 @@ import unittest -from reverse_string import reverse +from reverse_string import ( + reverse, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/rna-transcription/rna_transcription_test.py b/exercises/practice/rna-transcription/rna_transcription_test.py index 1d7193a042..aa06232959 100644 --- a/exercises/practice/rna-transcription/rna_transcription_test.py +++ b/exercises/practice/rna-transcription/rna_transcription_test.py @@ -1,6 +1,8 @@ import unittest -from rna_transcription import to_rna +from rna_transcription import ( + to_rna, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/robot-simulator/robot_simulator_test.py b/exercises/practice/robot-simulator/robot_simulator_test.py index e67402a38c..9622653290 100644 --- a/exercises/practice/robot-simulator/robot_simulator_test.py +++ b/exercises/practice/robot-simulator/robot_simulator_test.py @@ -1,6 +1,12 @@ import unittest -from robot_simulator import Robot, NORTH, EAST, SOUTH, WEST +from robot_simulator import ( + Robot, + NORTH, + EAST, + SOUTH, + WEST, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/roman-numerals/roman_numerals_test.py b/exercises/practice/roman-numerals/roman_numerals_test.py index 86d0edfa01..9a0c58deee 100644 --- a/exercises/practice/roman-numerals/roman_numerals_test.py +++ b/exercises/practice/roman-numerals/roman_numerals_test.py @@ -1,6 +1,8 @@ import unittest -from roman_numerals import roman +from roman_numerals import ( + roman, +) # Tests adapted from `problem-specifications//canonical-data.json` class RomanNumeralsTest(unittest.TestCase): diff --git a/exercises/practice/rotational-cipher/rotational_cipher_test.py b/exercises/practice/rotational-cipher/rotational_cipher_test.py index 1ba3fc1e2c..88b64d6edb 100644 --- a/exercises/practice/rotational-cipher/rotational_cipher_test.py +++ b/exercises/practice/rotational-cipher/rotational_cipher_test.py @@ -1,6 +1,8 @@ import unittest -from rotational_cipher import rotate +from rotational_cipher import ( + rotate, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/run-length-encoding/run_length_encoding_test.py b/exercises/practice/run-length-encoding/run_length_encoding_test.py index 6e302b3fb5..94b84c7391 100644 --- a/exercises/practice/run-length-encoding/run_length_encoding_test.py +++ b/exercises/practice/run-length-encoding/run_length_encoding_test.py @@ -1,6 +1,9 @@ import unittest -from run_length_encoding import encode, decode +from run_length_encoding import ( + encode, + decode, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/saddle-points/saddle_points_test.py b/exercises/practice/saddle-points/saddle_points_test.py index 77d96572aa..45b12b63a4 100644 --- a/exercises/practice/saddle-points/saddle_points_test.py +++ b/exercises/practice/saddle-points/saddle_points_test.py @@ -7,7 +7,9 @@ """ import unittest -from saddle_points import saddle_points +from saddle_points import ( + saddle_points, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -73,7 +75,7 @@ def test_can_identify_saddle_points_in_a_non_square_matrix(self): ) def test_can_identify_that_saddle_points_in_a_single_column_matrix_are_those_with_the_minimum_value( - self + self, ): matrix = [[2], [1], [4], [1]] self.assertEqual( @@ -82,7 +84,7 @@ def test_can_identify_that_saddle_points_in_a_single_column_matrix_are_those_wit ) def test_can_identify_that_saddle_points_in_a_single_row_matrix_are_those_with_the_maximum_value( - self + self, ): matrix = [[2, 5, 3, 5]] self.assertEqual( diff --git a/exercises/practice/satellite/satellite_test.py b/exercises/practice/satellite/satellite_test.py index 704d9e3f44..8f112fc8a1 100644 --- a/exercises/practice/satellite/satellite_test.py +++ b/exercises/practice/satellite/satellite_test.py @@ -1,6 +1,8 @@ import unittest -from satellite import tree_from_traversals +from satellite import ( + tree_from_traversals, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/say/say_test.py b/exercises/practice/say/say_test.py index aabbc2a515..1bc4b60cbf 100644 --- a/exercises/practice/say/say_test.py +++ b/exercises/practice/say/say_test.py @@ -1,6 +1,8 @@ import unittest -from say import say +from say import ( + say, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/scale-generator/scale_generator_test.py b/exercises/practice/scale-generator/scale_generator_test.py index 2be4a631f6..c22ef166fd 100644 --- a/exercises/practice/scale-generator/scale_generator_test.py +++ b/exercises/practice/scale-generator/scale_generator_test.py @@ -1,6 +1,8 @@ import unittest -from scale_generator import Scale +from scale_generator import ( + Scale, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/scrabble-score/scrabble_score_test.py b/exercises/practice/scrabble-score/scrabble_score_test.py index f3bce4f8e6..e8d7eff75e 100644 --- a/exercises/practice/scrabble-score/scrabble_score_test.py +++ b/exercises/practice/scrabble-score/scrabble_score_test.py @@ -1,6 +1,8 @@ import unittest -from scrabble_score import score +from scrabble_score import ( + score, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/secret-handshake/secret_handshake_test.py b/exercises/practice/secret-handshake/secret_handshake_test.py index 72d0e82515..42b8dcdc89 100644 --- a/exercises/practice/secret-handshake/secret_handshake_test.py +++ b/exercises/practice/secret-handshake/secret_handshake_test.py @@ -1,6 +1,8 @@ import unittest -from secret_handshake import commands +from secret_handshake import ( + commands, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/series/series_test.py b/exercises/practice/series/series_test.py index 94346d819b..78fb6619cf 100644 --- a/exercises/practice/series/series_test.py +++ b/exercises/practice/series/series_test.py @@ -1,6 +1,8 @@ import unittest -from series import slices +from series import ( + slices, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/sgf-parsing/sgf_parsing_test.py b/exercises/practice/sgf-parsing/sgf_parsing_test.py index 0baae4ead8..5f8ad91eaf 100644 --- a/exercises/practice/sgf-parsing/sgf_parsing_test.py +++ b/exercises/practice/sgf-parsing/sgf_parsing_test.py @@ -1,6 +1,9 @@ import unittest -from sgf_parsing import parse, SgfTree +from sgf_parsing import ( + parse, + SgfTree, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/sieve/sieve_test.py b/exercises/practice/sieve/sieve_test.py index c34146f48a..d9fa67262b 100644 --- a/exercises/practice/sieve/sieve_test.py +++ b/exercises/practice/sieve/sieve_test.py @@ -1,6 +1,8 @@ import unittest -from sieve import primes +from sieve import ( + primes, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/simple-cipher/simple_cipher_test.py b/exercises/practice/simple-cipher/simple_cipher_test.py index f3dd7875aa..07c0c3d5b5 100644 --- a/exercises/practice/simple-cipher/simple_cipher_test.py +++ b/exercises/practice/simple-cipher/simple_cipher_test.py @@ -1,7 +1,9 @@ import re import unittest -from simple_cipher import Cipher +from simple_cipher import ( + Cipher, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/space-age/space_age_test.py b/exercises/practice/space-age/space_age_test.py index e319daca14..b3f91ca067 100644 --- a/exercises/practice/space-age/space_age_test.py +++ b/exercises/practice/space-age/space_age_test.py @@ -1,6 +1,8 @@ import unittest -from space_age import SpaceAge +from space_age import ( + SpaceAge, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/spiral-matrix/spiral_matrix_test.py b/exercises/practice/spiral-matrix/spiral_matrix_test.py index 3bd5aef815..1291342a89 100644 --- a/exercises/practice/spiral-matrix/spiral_matrix_test.py +++ b/exercises/practice/spiral-matrix/spiral_matrix_test.py @@ -1,6 +1,8 @@ import unittest -from spiral_matrix import spiral_matrix +from spiral_matrix import ( + spiral_matrix, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/sublist/sublist_test.py b/exercises/practice/sublist/sublist_test.py index 382144f75a..03ff9cebed 100644 --- a/exercises/practice/sublist/sublist_test.py +++ b/exercises/practice/sublist/sublist_test.py @@ -1,6 +1,12 @@ import unittest -from sublist import sublist, SUBLIST, SUPERLIST, EQUAL, UNEQUAL +from sublist import ( + sublist, + SUBLIST, + SUPERLIST, + EQUAL, + UNEQUAL, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/sum-of-multiples/sum_of_multiples_test.py b/exercises/practice/sum-of-multiples/sum_of_multiples_test.py index c683dea1aa..f7e8bfb540 100644 --- a/exercises/practice/sum-of-multiples/sum_of_multiples_test.py +++ b/exercises/practice/sum-of-multiples/sum_of_multiples_test.py @@ -1,6 +1,8 @@ import unittest -from sum_of_multiples import sum_of_multiples +from sum_of_multiples import ( + sum_of_multiples, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -52,7 +54,7 @@ def test_the_factor_0_does_not_affect_the_sum_of_multiples_of_other_factors(self self.assertEqual(sum_of_multiples(4, [3, 0]), 3) def test_solutions_using_include_exclude_must_extend_to_cardinality_greater_than_3( - self + self, ): self.assertEqual(sum_of_multiples(10000, [2, 3, 5, 7, 11]), 39614537) diff --git a/exercises/practice/tournament/tournament_test.py b/exercises/practice/tournament/tournament_test.py index 4d0a0927e8..dac4c15c4b 100644 --- a/exercises/practice/tournament/tournament_test.py +++ b/exercises/practice/tournament/tournament_test.py @@ -1,6 +1,8 @@ import unittest -from tournament import tally +from tournament import ( + tally, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/transpose/transpose_test.py b/exercises/practice/transpose/transpose_test.py index e657086dfb..c47a3fdb19 100644 --- a/exercises/practice/transpose/transpose_test.py +++ b/exercises/practice/transpose/transpose_test.py @@ -1,6 +1,8 @@ import unittest -from transpose import transpose +from transpose import ( + transpose, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/triangle/triangle_test.py b/exercises/practice/triangle/triangle_test.py index e7ee2d3377..f95617b477 100644 --- a/exercises/practice/triangle/triangle_test.py +++ b/exercises/practice/triangle/triangle_test.py @@ -1,6 +1,10 @@ import unittest -from triangle import equilateral, isosceles, scalene +from triangle import ( + equilateral, + isosceles, + scalene, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/twelve-days/twelve_days_test.py b/exercises/practice/twelve-days/twelve_days_test.py index d2f90c8daf..9418eaf2b2 100644 --- a/exercises/practice/twelve-days/twelve_days_test.py +++ b/exercises/practice/twelve-days/twelve_days_test.py @@ -1,6 +1,8 @@ import unittest -from twelve_days import recite +from twelve_days import ( + recite, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/two-bucket/two_bucket_test.py b/exercises/practice/two-bucket/two_bucket_test.py index fd3cd1a5e0..15a2f6e0db 100644 --- a/exercises/practice/two-bucket/two_bucket_test.py +++ b/exercises/practice/two-bucket/two_bucket_test.py @@ -1,38 +1,40 @@ import unittest -from two_bucket import measure +from two_bucket import ( + measure, +) # Tests adapted from `problem-specifications//canonical-data.json` class TwoBucketTest(unittest.TestCase): def test_measure_using_bucket_one_of_size_3_and_bucket_two_of_size_5_start_with_bucket_one( - self + self, ): self.assertEqual(measure(3, 5, 1, "one"), (4, "one", 5)) def test_measure_using_bucket_one_of_size_3_and_bucket_two_of_size_5_start_with_bucket_two( - self + self, ): self.assertEqual(measure(3, 5, 1, "two"), (8, "two", 3)) def test_measure_using_bucket_one_of_size_7_and_bucket_two_of_size_11_start_with_bucket_one( - self + self, ): self.assertEqual(measure(7, 11, 2, "one"), (14, "one", 11)) def test_measure_using_bucket_one_of_size_7_and_bucket_two_of_size_11_start_with_bucket_two( - self + self, ): self.assertEqual(measure(7, 11, 2, "two"), (18, "two", 7)) def test_measure_one_step_using_bucket_one_of_size_1_and_bucket_two_of_size_3_start_with_bucket_two( - self + self, ): self.assertEqual(measure(1, 3, 3, "two"), (1, "two", 0)) def test_measure_using_bucket_one_of_size_2_and_bucket_two_of_size_3_start_with_bucket_one_and_end_with_bucket_two( - self + self, ): self.assertEqual(measure(2, 3, 3, "one"), (2, "two", 2)) diff --git a/exercises/practice/two-fer/two_fer_test.py b/exercises/practice/two-fer/two_fer_test.py index 90a2f937df..540930daf3 100644 --- a/exercises/practice/two-fer/two_fer_test.py +++ b/exercises/practice/two-fer/two_fer_test.py @@ -1,6 +1,8 @@ import unittest -from two_fer import two_fer +from two_fer import ( + two_fer, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/variable-length-quantity/variable_length_quantity_test.py b/exercises/practice/variable-length-quantity/variable_length_quantity_test.py index 1054b529e0..e6550d6480 100644 --- a/exercises/practice/variable-length-quantity/variable_length_quantity_test.py +++ b/exercises/practice/variable-length-quantity/variable_length_quantity_test.py @@ -1,6 +1,9 @@ import unittest -from variable_length_quantity import decode, encode +from variable_length_quantity import ( + decode, + encode, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/word-count/word_count_test.py b/exercises/practice/word-count/word_count_test.py index 5a28d28886..9450e215c9 100644 --- a/exercises/practice/word-count/word_count_test.py +++ b/exercises/practice/word-count/word_count_test.py @@ -1,6 +1,8 @@ import unittest -from word_count import count_words +from word_count import ( + count_words, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/word-search/word_search_test.py b/exercises/practice/word-search/word_search_test.py index 737f49ced3..857479abf0 100644 --- a/exercises/practice/word-search/word_search_test.py +++ b/exercises/practice/word-search/word_search_test.py @@ -1,6 +1,9 @@ import unittest -from word_search import WordSearch, Point +from word_search import ( + WordSearch, + Point, +) # Tests adapted from `problem-specifications//canonical-data.json` @@ -15,7 +18,7 @@ def test_should_locate_one_word_written_left_to_right(self): self.assertEqual(puzzle.search("clojure"), (Point(0, 0), Point(6, 0))) def test_should_locate_the_same_word_written_left_to_right_in_a_different_position( - self + self, ): puzzle = WordSearch(["mtclojurer"]) self.assertEqual(puzzle.search("clojure"), (Point(2, 0), Point(8, 0))) @@ -25,7 +28,7 @@ def test_should_locate_a_different_left_to_right_word(self): self.assertEqual(puzzle.search("coffee"), (Point(0, 0), Point(5, 0))) def test_should_locate_that_different_left_to_right_word_in_a_different_position( - self + self, ): puzzle = WordSearch(["xcoffeezlp"]) self.assertEqual(puzzle.search("coffee"), (Point(1, 0), Point(6, 0))) @@ -56,7 +59,7 @@ def test_should_locate_a_left_to_right_word_in_ten_line_grid(self): self.assertEqual(puzzle.search("clojure"), (Point(0, 9), Point(6, 9))) def test_should_locate_that_left_to_right_word_in_a_different_position_in_a_ten_line_grid( - self + self, ): puzzle = WordSearch( [ @@ -114,7 +117,7 @@ def test_should_locate_a_single_word_written_right_to_left(self): self.assertEqual(puzzle.search("elixir"), (Point(5, 0), Point(0, 0))) def test_should_locate_multiple_words_written_in_different_horizontal_directions( - self + self, ): puzzle = WordSearch( [ diff --git a/exercises/practice/wordy/wordy_test.py b/exercises/practice/wordy/wordy_test.py index 2ccc8eb215..101aef23f6 100644 --- a/exercises/practice/wordy/wordy_test.py +++ b/exercises/practice/wordy/wordy_test.py @@ -1,6 +1,8 @@ import unittest -from wordy import answer +from wordy import ( + answer, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/zebra-puzzle/zebra_puzzle_test.py b/exercises/practice/zebra-puzzle/zebra_puzzle_test.py index 88aaa96d75..034d4cccf4 100644 --- a/exercises/practice/zebra-puzzle/zebra_puzzle_test.py +++ b/exercises/practice/zebra-puzzle/zebra_puzzle_test.py @@ -1,6 +1,9 @@ import unittest -from zebra_puzzle import drinks_water, owns_zebra +from zebra_puzzle import ( + drinks_water, + owns_zebra, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/exercises/practice/zipper/zipper_test.py b/exercises/practice/zipper/zipper_test.py index a96bfa7d3a..81ab7486bd 100644 --- a/exercises/practice/zipper/zipper_test.py +++ b/exercises/practice/zipper/zipper_test.py @@ -1,6 +1,8 @@ import unittest -from zipper import Zipper +from zipper import ( + Zipper, +) # Tests adapted from `problem-specifications//canonical-data.json` diff --git a/requirements-generator.txt b/requirements-generator.txt index c98d8aa56a..7af3156b6c 100644 --- a/requirements-generator.txt +++ b/requirements-generator.txt @@ -1,4 +1,4 @@ -black==19.3b0 +black==20.8b1 flake8==3.7.8 Jinja2==2.10.1 python-dateutil==2.8.1