From c89df5fd0a2430250cffffd996c6a525be843b23 Mon Sep 17 00:00:00 2001 From: caddycarine Date: Fri, 7 Aug 2020 12:21:17 +0000 Subject: [PATCH] Add a long-run strategy to the filtering test (#1359) * Add a long-run strategy to the filtering test Currently `test_boolean_filtering` only uses strategies as given by the `strategy_list` hypothesis strategy. This by default only picks short run time strategies so we are not ensuring that the long run filter works. * Changed float to int in rst file Last PR failed checks, probably due to an int vs float issue in the dependencies. * Modify config.yml Specified isort version dependency to facilitate checks during commit. --- .github/workflows/config.yml | 4 ++-- axelrod/tests/integration/test_filtering.py | 1 + docs/tutorials/advanced/tournament_results.rst | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index 4599f2d8f..636ade0fe 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -51,8 +51,8 @@ jobs: python run_mypy.py - name: Check imports are sorted run: | - python -m pip install isort - python -m isort --check-only + python -m pip install "isort==4.3.21" + python -m isort --check-only --recursive axelrod/. - name: Check that all strategies are indexed run: | python run_strategy_indexer.py diff --git a/axelrod/tests/integration/test_filtering.py b/axelrod/tests/integration/test_filtering.py index cddffd3da..86a79a7f4 100644 --- a/axelrod/tests/integration/test_filtering.py +++ b/axelrod/tests/integration/test_filtering.py @@ -21,6 +21,7 @@ def tearDown(self) -> None: warnings.simplefilter("default", category=UserWarning) @given(strategies=strategy_lists(min_size=20, max_size=20)) + @example(strategies=[axl.DBS, axl.Cooperator]) def test_boolean_filtering(self, strategies): classifiers = [ diff --git a/docs/tutorials/advanced/tournament_results.rst b/docs/tutorials/advanced/tournament_results.rst index f2778ebfa..72ca2e4a8 100644 --- a/docs/tutorials/advanced/tournament_results.rst +++ b/docs/tutorials/advanced/tournament_results.rst @@ -343,7 +343,7 @@ This gives the count of cooperations made by each player during the first turn of every match:: >>> results.initial_cooperation_count - [9.0, 0.0, 9.0, 9.0] + [9, 0, 9, 9] Each player plays an opponent a total of 9 times (3 opponents and 3 repetitions). Apart from the :code:`Defector`, they all cooperate on the first