]> Cypherpunks repositories - keks.git/commitdiff
Move everything-strategy as it will be used
authorSergey Matveev <stargrave@stargrave.org>
Sat, 30 Nov 2024 18:34:54 +0000 (21:34 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 30 Nov 2024 19:38:56 +0000 (22:38 +0300)
pyac/tests/strategies.py
pyac/tests/test_everything.py

index 2f0aa644b3426a68b66d9075ba8f366c051b63fa8b575f689dc436d249e84f91..6d18d12b4be6cf527aef8458d0b0a5fd82358ed773b8d0f47e09a91db664ee0f 100644 (file)
@@ -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)
+)
index 66474e2abc0b81050946771a0f2c22b1bfa23241611fbf354516838125d2dc80..86b895b32330ef3245c9b1e401edd980f1ed410e4b9d801a6ab317468ee195b4 100644 (file)
@@ -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):