Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixtures should remain static during fixture construction #13

Closed
domanchi opened this issue Sep 14, 2019 · 1 comment
Closed

fixtures should remain static during fixture construction #13

domanchi opened this issue Sep 14, 2019 · 1 comment
Assignees

Comments

@domanchi
Copy link
Contributor

Issue

Essentially, this test case.

diff --git a/tests/integration/supplements/factory_integration_test.py b/tests/integration/supplements/factory_integration_test.py
index 8361f33..9431d4f 100644
--- a/tests/integration/supplements/factory_integration_test.py
+++ b/tests/integration/supplements/factory_integration_test.py
@@ -16,3 +16,33 @@ def test_type_hinting(mock_client):
 
     assert request.fuzzed_input['string'] == '1'
     assert request.fuzzed_input['integer'] == 1
+
+
+def test_session_fixtures(mock_client):
+    count = 0
+    def nested_function():
+        nonlocal count
+        count += 1
+        return count
+
+    def child_a(nested):
+        return nested
+
+    def child_b(nested):
+        return nested
+
+    def function(a, b):
+        assert a == b
+        return 'does_not_matter'
+
+    fuzz_lightyear.register_factory('nested')(nested_function)
+    fuzz_lightyear.register_factory('a')(child_a)
+    fuzz_lightyear.register_factory('b')(child_b)
+    fuzz_lightyear.register_factory('string')(function)
+
+    request = FuzzingRequest(
+        operation_id='get_expect_primitives',
+        tag='types',
+    )
+    request.send()
+
@domanchi
Copy link
Contributor Author

Changes have been made, and improvements have been ticketed (#19). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants