From 962802aabb9cd6d501cdfe9f02179f42ad95b1e6 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sat, 24 Aug 2024 14:36:37 -0700 Subject: [PATCH] Move unused function to test --- .../src/hypothesis/internal/conjecture/data.py | 8 -------- hypothesis-python/tests/conjecture/test_alt_backend.py | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hypothesis-python/src/hypothesis/internal/conjecture/data.py b/hypothesis-python/src/hypothesis/internal/conjecture/data.py index cc1f71da96..18f3bd9b8a 100644 --- a/hypothesis-python/src/hypothesis/internal/conjecture/data.py +++ b/hypothesis-python/src/hypothesis/internal/conjecture/data.py @@ -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( diff --git a/hypothesis-python/tests/conjecture/test_alt_backend.py b/hypothesis-python/tests/conjecture/test_alt_backend.py index 0107cab654..7a0c8122bb 100644 --- a/hypothesis-python/tests/conjecture/test_alt_backend.py +++ b/hypothesis-python/tests/conjecture/test_alt_backend.py @@ -18,6 +18,7 @@ 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 @@ -25,7 +26,6 @@ AVAILABLE_PROVIDERS, ConjectureData, PrimitiveProvider, - realize, ) from hypothesis.internal.conjecture.engine import ConjectureRunner from hypothesis.internal.floats import SIGNALING_NAN @@ -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()