Skip to content

Commit ecf33f2

Browse files
committed
early execution: test base functionality in both modes
1 parent af67d4d commit ecf33f2

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tests/execution/test_defer.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ def can_print_deferred_fragment_record():
531531
str(record) == "DeferredFragmentRecord(parent, path=['bar'], label='foo')"
532532
)
533533

534-
async def can_defer_fragments_containing_scalar_types():
534+
@pytest.mark.parametrize("early_execution", [False, True])
535+
async def can_defer_fragments_containing_scalar_types(early_execution):
535536
"""Can defer fragments containing scalar types"""
536537
document = parse(
537538
"""
@@ -546,7 +547,7 @@ async def can_defer_fragments_containing_scalar_types():
546547
}
547548
"""
548549
)
549-
result = await complete(document)
550+
result = await complete(document, enable_early_execution=early_execution)
550551

551552
assert result == [
552553
{
@@ -743,7 +744,8 @@ async def throws_an_error_for_defer_directive_with_non_string_label():
743744
],
744745
}
745746

746-
async def can_defer_fragments_on_the_top_level_query_field():
747+
@pytest.mark.parametrize("early_execution", [False, True])
748+
async def can_defer_fragments_on_the_top_level_query_field(early_execution):
747749
"""Can defer fragments on the top level Query field"""
748750
document = parse(
749751
"""
@@ -757,7 +759,7 @@ async def can_defer_fragments_on_the_top_level_query_field():
757759
}
758760
"""
759761
)
760-
result = await complete(document)
762+
result = await complete(document, enable_early_execution=early_execution)
761763

762764
assert result == [
763765
{

tests/execution/test_stream.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,14 @@ def can_print_stream_record():
261261
record = StreamRecord(queue, path, "foo")
262262
assert str(record) == f"StreamRecord({expected_args}, label='foo')"
263263

264-
async def can_stream_a_list_field():
264+
@pytest.mark.parametrize("early_execution", [False, True])
265+
async def can_stream_a_list_field(early_execution):
265266
"""Can stream a list field"""
266267
document = parse("{ scalarList @stream(initialCount: 1) }")
267268
result = await complete(
268-
document, {"scalarList": ["apple", "banana", "coconut"]}
269+
document,
270+
{"scalarList": ["apple", "banana", "coconut"]},
271+
enable_early_execution=early_execution,
269272
)
270273
assert result == [
271274
{

0 commit comments

Comments
 (0)