From 9f3c159d1cc180677d66a14021feefad28443935 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sun, 24 Sep 2023 11:42:25 -0700 Subject: [PATCH] Delete obsolete code --- hypothesis-python/src/hypothesis/executors.py | 15 +-------------- hypothesis-python/tests/cover/test_executors.py | 7 ------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/hypothesis-python/src/hypothesis/executors.py b/hypothesis-python/src/hypothesis/executors.py index b7ea77dfb1..e19921bbed 100644 --- a/hypothesis-python/src/hypothesis/executors.py +++ b/hypothesis-python/src/hypothesis/executors.py @@ -9,10 +9,6 @@ # obtain one at https://mozilla.org/MPL/2.0/. -def default_executor(function): # pragma: nocover - raise NotImplementedError # We don't actually use this any more - - def setup_teardown_executor(setup, teardown): setup = setup or (lambda: None) teardown = teardown or (lambda ex: None) @@ -40,26 +36,17 @@ def executor(runner): getattr(runner, "teardown_example", None), ) - return default_executor - def default_new_style_executor(data, function): return function(data) -class ConjectureRunner: - def hypothesis_execute_example_with_data(self, data, function): - return function(data) - - def new_style_executor(runner): if runner is None: return default_new_style_executor - if isinstance(runner, ConjectureRunner): - return runner.hypothesis_execute_example_with_data old_school = executor(runner) - if old_school is default_executor: + if old_school is None: return default_new_style_executor else: return lambda data, function: old_school(lambda: function(data)) diff --git a/hypothesis-python/tests/cover/test_executors.py b/hypothesis-python/tests/cover/test_executors.py index 4dd5a69646..a70ef0a3a9 100644 --- a/hypothesis-python/tests/cover/test_executors.py +++ b/hypothesis-python/tests/cover/test_executors.py @@ -14,7 +14,6 @@ import pytest from hypothesis import example, given -from hypothesis.executors import ConjectureRunner from hypothesis.strategies import booleans, integers @@ -78,9 +77,3 @@ def test_no_boom(): def test_no_boom_on_example(): Valueless().test_no_boom_on_example() - - -class TestNormal(ConjectureRunner, TestCase): - @given(booleans()) - def test_stuff(self, b): - pass