Skip to content

Commit

Permalink
Delete obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Sep 24, 2023
1 parent 7e3c654 commit 9f3c159
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
15 changes: 1 addition & 14 deletions hypothesis-python/src/hypothesis/executors.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
7 changes: 0 additions & 7 deletions hypothesis-python/tests/cover/test_executors.py
Expand Up @@ -14,7 +14,6 @@
import pytest

from hypothesis import example, given
from hypothesis.executors import ConjectureRunner
from hypothesis.strategies import booleans, integers


Expand Down Expand Up @@ -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

0 comments on commit 9f3c159

Please sign in to comment.