From 59bb7bdd5db5da1d97306fd08d4ecd3ea6db38d0 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 8 Feb 2018 10:51:59 +0000 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20parametrize=20on=20government?= =?UTF-8?q?=20domains?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There’s over 1000 domains in our file. This is too much for parametrize to handle when running the tests on multiple cores. End up with this error: ``` Different tests were collected between gw1 and gw2. ``` --- tests/app/test_utils.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/app/test_utils.py b/tests/app/test_utils.py index 36c49f2d0..0dc7e3b8f 100644 --- a/tests/app/test_utils.py +++ b/tests/app/test_utils.py @@ -350,21 +350,22 @@ def test_get_valid_government_domain_gets_most_specific_first(): assert specific.agreement_signed is True -@pytest.mark.parametrize('domain', GovernmentDomain.domains.keys()) -def test_validate_government_domain_data(domain): +def test_validate_government_domain_data(): - government_domain = GovernmentDomain(domain) + for domain in GovernmentDomain.domains.keys(): - assert government_domain.crown_status in { - True, False, None - } + government_domain = GovernmentDomain(domain) - assert ( - government_domain.owner is None - ) or ( - isinstance(government_domain.owner, str) - ) + assert government_domain.crown_status in { + True, False, None + } - assert government_domain.agreement_signed in { - True, False, None - } + assert ( + government_domain.owner is None + ) or ( + isinstance(government_domain.owner, str) + ) + + assert government_domain.agreement_signed in { + True, False, None + }