Skip to content

Commit

Permalink
Move unused function to test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Aug 24, 2024
1 parent c90732c commit 962802a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 0 additions & 8 deletions hypothesis-python/src/hypothesis/internal/conjecture/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1935,14 +1935,6 @@ def permitted(f):
}


# eventually we'll want to expose this publicly, but for now it lives as psuedo-internal.
def realize(value: object) -> object:
from hypothesis.control import current_build_context

context = current_build_context()
return context.data.provider.realize(value)


class ConjectureData:
@classmethod
def for_buffer(
Expand Down
4 changes: 2 additions & 2 deletions hypothesis-python/tests/conjecture/test_alt_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
import pytest

from hypothesis import given, settings, strategies as st
from hypothesis.control import current_build_context
from hypothesis.database import InMemoryExampleDatabase
from hypothesis.errors import Flaky, HypothesisException, InvalidArgument
from hypothesis.internal.compat import int_to_bytes
from hypothesis.internal.conjecture.data import (
AVAILABLE_PROVIDERS,
ConjectureData,
PrimitiveProvider,
realize,
)
from hypothesis.internal.conjecture.engine import ConjectureRunner
from hypothesis.internal.floats import SIGNALING_NAN
Expand Down Expand Up @@ -412,7 +412,7 @@ def test_realize():
@given(st.integers())
@settings(backend="realize")
def test_function(n):
values.append(realize(n))
values.append(current_build_context().data.provider.realize(n))

test_function()

Expand Down

0 comments on commit 962802a

Please sign in to comment.