From c894064d0e3b565523148b39d53988ffa8093b7d5747a948f8443794271ed498 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 30 Nov 2024 21:34:54 +0300 Subject: [PATCH] Move everything-strategy as it will be used --- pyac/tests/strategies.py | 8 ++++++++ pyac/tests/test_everything.py | 13 +------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/pyac/tests/strategies.py b/pyac/tests/strategies.py index 2f0aa64..6d18d12 100644 --- a/pyac/tests/strategies.py +++ b/pyac/tests/strategies.py @@ -2,8 +2,11 @@ from hypothesis.strategies import binary from hypothesis.strategies import booleans from hypothesis.strategies import characters from hypothesis.strategies import datetimes +from hypothesis.strategies import deferred +from hypothesis.strategies import dictionaries from hypothesis.strategies import integers from hypothesis.strategies import just +from hypothesis.strategies import lists from hypothesis.strategies import none from hypothesis.strategies import one_of from hypothesis.strategies import text @@ -29,3 +32,8 @@ any_st = one_of( uuids(), datetimes(), ) +everything_st = deferred( + lambda: any_st | + lists(everything_st, max_size=4) | + dictionaries(mapkey_st, everything_st, max_size=4) +) diff --git a/pyac/tests/test_everything.py b/pyac/tests/test_everything.py index 66474e2..86b895b 100644 --- a/pyac/tests/test_everything.py +++ b/pyac/tests/test_everything.py @@ -2,22 +2,11 @@ from typing import Any from unittest import TestCase from hypothesis import given -from hypothesis.strategies import deferred -from hypothesis.strategies import dictionaries -from hypothesis.strategies import lists from pyac import dumps from pyac import loads -from tests.strategies import any_st from tests.strategies import junk_st -from tests.strategies import mapkey_st - - -everything_st = deferred( - lambda: any_st | - lists(everything_st, max_size=4) | - dictionaries(mapkey_st, everything_st, max_size=4) -) +from tests.strategies import everything_st class TestEverything(TestCase): -- 2.50.0