repo_id stringclasses 409
values | prefix large_stringlengths 34 36.3k | target large_stringlengths 1 498 | assertion_type stringclasses 31
values | difficulty stringclasses 8
values | test_file stringlengths 10 121 | test_function stringlengths 1 104 | test_class stringlengths 0 51 | lineno int32 2 11.3k | commit_idx int32 |
|---|---|---|---|---|---|---|---|---|---|
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .conftest import MS, WebSocketServerHelp... | 5 | assert | numeric_literal | tests/test_graphqlws_subscription.py | test_graphqlws_subscription_break | 275 | null | |
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from graphql import ExecutionResult
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .con... | 4 | assert | numeric_literal | tests/test_websocket_subscription.py | test_websocket_subscription_sync_graceful_shutdown | 618 | null | |
graphql-python/gql | import asyncio
import json
import sys
from typing import Any, Dict, Mapping
import pytest
from gql import Client, gql
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportConnectionFailed,
TransportQueryError,
TransportServerError,
)
from .conftest import MS, WebSocketServerHelp... | None | assert | none_literal | tests/test_aiohttp_websocket_query.py | test_aiohttp_websocket_connect_failed_with_authentication_in_connection_init | 530 | null | |
graphql-python/gql | import asyncio
import json
from unittest.mock import AsyncMock, patch
import pytest
from gql import Client, gql
from gql.graphql_request import GraphQLRequest
from gql.transport.exceptions import (
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
TransportServerError,
)
pytestmark ... | "Book 2" | assert | string_literal | tests/test_aiohttp_multipart.py | test_aiohttp_multipart_subscription | 125 | null | |
graphql-python/gql | import asyncio
import json
from base64 import b64decode
from typing import List
from urllib import parse
import pytest
from gql import Client, gql
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.websockets
SEND_MESSAGE_DELAY = 20 * MS
NB_MESSAGES = 10
DUMMY_API_KEY = "da2-thisisadummyapik... | str(exc_info) | assert | func_call | tests/test_appsync_websockets.py | test_appsync_fetch_schema_from_transport_not_allowed | 551 | null | |
graphql-python/gql | import os
from contextlib import suppress
from typing import Any
from unittest import mock
import pytest
from graphql import ExecutionResult, build_ast_schema, parse
from gql import Client, GraphQLRequest, gql
from gql.transport import Transport
from gql.transport.exceptions import TransportQueryError
def http_trans... | TypeError) | pytest.raises | variable | tests/test_client.py | test_request_transport_not_implemented | 35 | null | |
graphql-python/gql | from typing import Any, Dict
import pytest
from graphql import GraphQLError
from gql import gql
from gql.utilities import parse_result
from tests.starwars.schema import StarWarsSchema
def test_hero_name_and_friends_query():
query = gql(
"""
query HeroNameAndFriendsQuery {
hero {
... | parsed_result | assert | variable | tests/starwars/test_parse_results.py | test_hero_name_and_friends_query | 40 | null | |
graphql-python/gql | import os
from typing import Any, Dict, Mapping
import pytest
from gql import Client, FileVar, gql
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
TransportQueryError,
TransportServerError,
)
from .conftest ... | "3600" | assert | string_literal | tests/test_httpx.py | test_code | 323 | null | |
graphql-python/gql | import os
from contextlib import suppress
from typing import Any
from unittest import mock
import pytest
from graphql import ExecutionResult, build_ast_schema, parse
from gql import Client, GraphQLRequest, gql
from gql.transport import Transport
from gql.transport.exceptions import TransportQueryError
def http_trans... | AssertionError) | pytest.raises | variable | tests/test_client.py | test_no_schema_no_transport_exception | 109 | null | |
graphql-python/gql | import asyncio
import json
import types
from typing import List
import pytest
from gql import Client, gql
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportConnectionFailed,
TransportProtocolError,
TransportQueryError,
)
from .conftest import MS, WebSocketServerHelper
pytest... | asyncio.TimeoutError) | pytest.raises | complex_expr | tests/test_websocket_exceptions.py | test_websocket_server_does_not_send_ack | 122 | null | |
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .conftest import MS, WebSocketServerHelp... | True | assert | bool_literal | tests/test_aiohttp_websocket_graphqlws_subscription.py | test_aiohttp_websocket_graphqlws_subscription_task_cancel | 328 | null | |
graphql-python/gql | import asyncio
import json
import logging
import os
import pathlib
import platform
import re
import ssl
import sys
import tempfile
import types
from concurrent.futures import ThreadPoolExecutor
from typing import Callable, Iterable, List, Union, cast
import pytest
import pytest_asyncio
from _pytest.fixtures import Sub... | str(i) | assert | func_call | tests/conftest.py | single_upload_handler | 804 | null | |
graphql-python/gql | from enum import Enum
from typing import Optional
import pytest
from graphql import (
GraphQLArgument,
GraphQLEnumType,
GraphQLField,
GraphQLList,
GraphQLNamedType,
GraphQLNonNull,
GraphQLObjectType,
GraphQLSchema,
)
from gql import Client, gql
from gql.utilities import update_schema_e... | KeyError) | pytest.raises | variable | tests/custom_scalars/test_enum_colors.py | test_update_schema_enum_errors | 282 | null | |
graphql-python/gql | import asyncio
from typing import Mapping
import pytest
from gql import Client, GraphQLRequest, gql
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
TransportServerError,
)
pytestmark = pytest.mark.aiohttp
query1_str = """
query getContinents {... | "Africa" | assert | string_literal | tests/test_aiohttp_batch.py | test_aiohttp_batch_online_manual | 523 | null | |
graphql-python/gql | import io
import json
from typing import Any, Dict, Mapping
import pytest
from gql import Client, FileVar, gql
from gql.cli import get_parser, main
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
TransportQueryEr... | "Europe" | assert | string_literal | tests/test_httpx_async.py | test_httpx_query_variable_values | 512 | null | |
graphql-python/gql | import asyncio
import json
import logging
import os
import pathlib
import platform
import re
import ssl
import sys
import tempfile
import types
from concurrent.futures import ThreadPoolExecutor
from typing import Callable, Iterable, List, Union, cast
import pytest
import pytest_asyncio
from _pytest.fixtures import Sub... | "map" | assert | string_literal | tests/conftest.py | single_upload_handler | 798 | null | |
graphql-python/gql | from typing import Any, Dict
import pytest
from graphql import GraphQLError
from gql import gql
from gql.utilities import parse_result
from tests.starwars.schema import StarWarsSchema
def test_invalid_result_raise_error():
query = gql(
"""
{
hero {
id
}
}
... | str(exc_info) | assert | func_call | tests/starwars/test_parse_results.py | test_invalid_result_raise_error | 119 | null | |
graphql-python/gql | import pytest
from graphql import print_schema
from gql import Client
from .fixtures import make_starwars_transport
pytestmark = pytest.mark.aiohttp
@pytest.mark.asyncio
async def test_starwars_introspection_args(aiohttp_server):
transport = await make_starwars_transport(aiohttp_server)
# First fetch the ... | schema_str | assert | variable | tests/starwars/test_introspection.py | test_starwars_introspection_args | 30 | null | |
graphql-python/gql | import pytest
from gql import Client, gql
@pytest.mark.requests
@pytest.mark.online
@pytest.mark.asyncio
@pytest.mark.parametrize("fetch_schema_from_transport", [True, False])
async def test_async_client_sync_transport(fetch_schema_from_transport):
from gql.transport.requests import RequestsHTTPTransport
ur... | AssertionError) | pytest.raises | variable | tests/test_http_async_sync.py | test_async_client_sync_transport | 64 | null | |
graphql-python/gql | import asyncio
import json
import logging
import os
import pathlib
import platform
import re
import ssl
import sys
import tempfile
import types
from concurrent.futures import ThreadPoolExecutor
from typing import Callable, Iterable, List, Union, cast
import pytest
import pytest_asyncio
from _pytest.fixtures import Sub... | None | assert | none_literal | tests/conftest.py | make_upload_handler | 779 | null | |
graphql-python/gql | import asyncio
import sys
from typing import Dict
import pytest
from gql import Client, gql
from gql.transport.exceptions import TransportQueryError
@pytest.mark.httpx
@pytest.mark.online
@pytest.mark.asyncio
async def test_httpx_simple_query():
from gql.transport.httpx import HTTPXAsyncTransport
# Create ... | "AF" | assert | string_literal | tests/test_httpx_online.py | test_httpx_simple_query | 53 | null | |
graphql-python/gql | import io
import json
import os
import warnings
from typing import Mapping
import pytest
from gql import Client, FileVar, gql
from gql.cli import get_parser, main
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
T... | "3600" | assert | string_literal | tests/test_aiohttp.py | test_aiohttp_error_code_429 | 231 | null | |
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from graphql import ExecutionResult
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .con... | 5 | assert | numeric_literal | tests/test_websocket_subscription.py | test_websocket_subscription_break | 197 | null | |
graphql-python/gql | import asyncio
from math import isfinite
from typing import Any, Dict, NamedTuple, Optional
import pytest
from graphql.error import GraphQLError
from graphql.language import ValueNode
from graphql.pyutils import inspect
from graphql.type import (
GraphQLArgument,
GraphQLField,
GraphQLFloat,
GraphQLList... | strip_braces_spaces(expected_payload) | assert | func_call | tests/test_graphql_request.py | test_graphql_request_using_string_instead_of_document | 212 | null | |
graphql-python/gql | import logging
import pytest
from gql import __version__
from gql.cli import (
get_execute_args,
get_introspection_args,
get_parser,
get_transport,
get_transport_args,
main,
)
def parser():
return get_parser()
def test_cli_parse_schema_download(parser):
args = parser.parse_args(
... | expected_args | assert | variable | tests/test_cli.py | test_cli_parse_schema_download | 426 | null | |
graphql-python/gql | import asyncio
import json
import sys
from typing import Any, Dict, Mapping
import pytest
from gql import Client, gql
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportConnectionFailed,
TransportQueryError,
TransportServerError,
)
from .conftest import MS, WebSocketServerHelp... | "1234" | assert | string_literal | tests/test_websocket_query.py | test_websocket_starting_client_in_context_manager | 63 | null | |
graphql-python/gql | import logging
import pytest
from gql import __version__
from gql.cli import (
get_execute_args,
get_introspection_args,
get_parser,
get_transport,
get_transport_args,
main,
)
def parser():
return get_parser()
def test_cli_parser(parser):
# Simple call with https server
# gql-cl... | 1 | assert | numeric_literal | tests/test_cli.py | test_cli_parser | 80 | null | |
graphql-python/gql | import asyncio
from typing import Mapping
import pytest
from gql import Client, GraphQLRequest, gql
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
TransportServerError,
)
pytestmark = pytest.mark.aiohttp
query1_str = """
query getContinents {... | "Europe" | assert | string_literal | tests/test_aiohttp_batch.py | test_aiohttp_batch_online_manual | 522 | null | |
graphql-python/gql | import asyncio
import json
from unittest.mock import AsyncMock, patch
import pytest
from gql import Client, gql
from gql.graphql_request import GraphQLRequest
from gql.transport.exceptions import (
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
TransportServerError,
)
pytestmark ... | "Book 1" | assert | string_literal | tests/test_aiohttp_multipart.py | test_aiohttp_multipart_subscription | 124 | null | |
graphql-python/gql | import asyncio
import json
from base64 import b64decode
from typing import List
from urllib import parse
import pytest
from gql import Client, gql
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.websockets
SEND_MESSAGE_DELAY = 20 * MS
NB_MESSAGES = 10
DUMMY_API_KEY = "da2-thisisadummyapik... | headers | assert | variable | tests/test_appsync_websockets.py | verify_headers | 61 | null | |
graphql-python/gql | import pytest
from gql import Client, gql
from gql.transport.exceptions import TransportConnectionFailed
from .conftest import get_localhost_ssl_context_client
pytestmark = pytest.mark.websockets
query1_str = """
query getContinents {
continents {
code
name
}
}
"""
default_query... | str(cause) | assert | func_call | tests/test_phoenix_channel_query.py | test_phoenix_channel_query_ssl_self_cert_fail | 146 | null | |
graphql-python/gql | import os
from contextlib import suppress
from typing import Any
from unittest import mock
import pytest
from graphql import ExecutionResult, build_ast_schema, parse
from gql import Client, GraphQLRequest, gql
from gql.transport import Transport
from gql.transport.exceptions import TransportQueryError
def http_trans... | str(exc_info.value) | assert | func_call | tests/test_client.py | test_request_transport_not_implemented | 38 | null | |
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .conftest import MS, WebSocketServerHelp... | 0 | assert | numeric_literal | tests/test_aiohttp_websocket_graphqlws_subscription.py | test_aiohttp_websocket_graphqlws_subscription_task_cancel | 327 | null | |
graphql-python/gql | import pytest
from gql import Client
from gql.dsl import DSLQuery, DSLSchema, dsl_gql
from tests.nested_input.schema import NestedInputSchema
def ds():
return DSLSchema(NestedInputSchema)
def client():
return Client(schema=NestedInputSchema)
def test_nested_input(ds, client):
query = dsl_gql(DSLQuery(ds... | {"echo": '{"foo": 1}'} | assert | collection | tests/nested_input/test_nested_input.py | test_nested_input | 20 | null | |
graphql-python/gql | import json
from typing import Mapping
import pytest
from graphql import print_ast
from gql import gql
from gql.transport.exceptions import TransportConnectionFailed
pytestmark = pytest.mark.websockets
query1_str = """
query getContinents {
continents {
code
name
}
}
"""
query1_... | AssertionError) | pytest.raises | variable | tests/test_websockets_adapter.py | test_websockets_adapter_edge_cases | 88 | null | |
graphql-python/gql | import asyncio
import json
import graphql
import pytest
from gql import Client, gql
from .conftest import MS, WebSocketServerHelper
from .starwars.schema import StarWarsIntrospection, StarWarsSchema, StarWarsTypeDef
starwars_expected_one = {
"stars": 3,
"commentary": "Was expecting more stuff",
"episode... | expected | assert | variable | tests/test_async_client_validation.py | test_async_client_validation_fetch_schema_from_server_valid_query | 220 | null | |
graphql-python/gql | import pytest
from gql import Client
from gql.dsl import DSLQuery, DSLSchema, dsl_gql
from tests.nested_input.schema import NestedInputSchema
def ds():
return DSLSchema(NestedInputSchema)
def client():
return Client(schema=NestedInputSchema)
def test_nested_input_2(ds, client):
query = dsl_gql(
... | {"echo": '{"foo": 1, "child": {"foo": 2}}'} | assert | collection | tests/nested_input/test_nested_input.py | test_nested_input_2 | 27 | null | |
graphql-python/gql | import asyncio
from math import isfinite
from typing import Any, Dict, NamedTuple, Optional
import pytest
from graphql.error import GraphQLError
from graphql.language import ValueNode
from graphql.pyutils import inspect
from graphql.type import (
GraphQLArgument,
GraphQLField,
GraphQLFloat,
GraphQLList... | {"money": {"amount": 10, "currency": "DM"}} | assert | collection | tests/test_graphql_request.py | test_serialize_variables_using_money_example | 202 | null | |
graphql-python/gql | from typing import Any, Dict, Optional
import pytest
from graphql import (
GraphQLArgument,
GraphQLError,
GraphQLField,
GraphQLFloat,
GraphQLInt,
GraphQLNonNull,
GraphQLObjectType,
GraphQLScalarType,
GraphQLSchema,
)
from graphql.language import ValueNode
from graphql.utilities impo... | "Tom" | assert | string_literal | tests/custom_scalars/test_json.py | test_json_value_input_in_ast | 137 | null | |
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from graphql import ExecutionResult
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .con... | count | assert | variable | tests/test_websocket_subscription.py | test_websocket_subscription | 142 | null | |
graphql-python/gql | import asyncio
import json
from base64 import b64decode
from typing import List
from urllib import parse
import pytest
from gql import Client, gql
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.websockets
SEND_MESSAGE_DELAY = 20 * MS
NB_MESSAGES = 10
DUMMY_API_KEY = "da2-thisisadummyapik... | AssertionError) | pytest.raises | variable | tests/test_appsync_websockets.py | test_appsync_fetch_schema_from_transport_not_allowed | 548 | null | |
graphql-python/gql | import io
import json
import os
import warnings
from typing import Mapping
import pytest
from gql import Client, FileVar, gql
from gql.cli import get_parser, main
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
T... | "val1" | assert | string_literal | tests/test_aiohttp.py | test_aiohttp_query_with_extensions | 1,378 | null | |
graphql-python/gql | import asyncio
import json
import pytest
from parse import search
from gql import Client, gql
pytestmark = pytest.mark.websockets
test_channel = "test_channel"
test_subscription_id = "test_subscription"
channel_leave_reply_template = (
"{{"
'"topic":"{channel_name}",'
'"event":"phx_reply",'
'"paylo... | end_count | assert | variable | tests/test_phoenix_channel_subscription.py | test_phoenix_channel_subscription | 218 | null | |
graphql-python/gql | import asyncio
import json
from unittest.mock import AsyncMock, patch
import pytest
from gql import Client, gql
from gql.graphql_request import GraphQLRequest
from gql.transport.exceptions import (
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
TransportServerError,
)
pytestmark ... | 2 | assert | numeric_literal | tests/test_aiohttp_multipart.py | test_aiohttp_multipart_subscription | 123 | null | |
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .conftest import MS, WebSocketServerHelp... | True | assert | bool_literal | tests/test_graphqlws_subscription.py | test_graphqlws_subscription_task_cancel | 326 | null | |
graphql-python/gql | import asyncio
from typing import Mapping
import pytest
from gql import Client, GraphQLRequest, gql
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
TransportServerError,
)
pytestmark = pytest.mark.aiohttp
query1_str = """
query getContinents {... | str(exc_info.value) | assert | func_call | tests/test_aiohttp_batch.py | test_aiohttp_batch_error_code_401 | 262 | null | |
graphql-python/gql | from graphql import GraphQLSchema
from gql import Client, gql
from gql.dsl import DSLFragment, DSLQuery, DSLSchema, dsl_gql, print_ast
from gql.utilities import node_tree
schema_str = """
type MonsterForm {
sprites: MonsterFormSprites!
}
union SpriteUnion = Sprite | CopyOf
type Query {
monster: [Monster!]!
}
t... | gql_tree | assert | variable | tests/regressions/issue_447_dsl_missing_directives/test_dsl_directives.py | test_issue_447 | 79 | null | |
graphql-python/gql | from typing import Mapping
import pytest
from gql import Client, GraphQLRequest
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
)
pytestmark = pytest.mark.httpx
query1_str = """
query getContinents {
continents {
code
name
... | TransportClosed) | pytest.raises | variable | tests/test_httpx_batch.py | test_httpx_async_batch_cannot_execute_if_not_connected | 260 | null | |
graphql-python/gql | from typing import Any, Dict
import pytest
from graphql import GraphQLError
from gql import gql
from gql.utilities import parse_result
from tests.starwars.schema import StarWarsSchema
def test_invalid_result_raise_error():
query = gql(
"""
{
hero {
id
}
}
... | GraphQLError) | pytest.raises | variable | tests/starwars/test_parse_results.py | test_invalid_result_raise_error | 115 | null | |
graphql-python/gql | import asyncio
import json
import sys
from typing import Any, Dict, Mapping
import pytest
from gql import Client, gql
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportConnectionFailed,
TransportQueryError,
TransportServerError,
)
from .conftest import MS, WebSocketServerHelp... | True | assert | bool_literal | tests/test_websocket_query.py | test_websocket_starting_client_in_context_manager | 67 | null | |
graphql-python/gql | from typing import Any, Dict, Optional
import pytest
from graphql import (
GraphQLArgument,
GraphQLError,
GraphQLField,
GraphQLFloat,
GraphQLInt,
GraphQLNonNull,
GraphQLObjectType,
GraphQLScalarType,
GraphQLSchema,
)
from graphql.language import ValueNode
from graphql.utilities impo... | str(exc_info.value) | assert | func_call | tests/custom_scalars/test_json.py | test_none_json_value_input_in_dsl_argument | 218 | null | |
graphql-python/gql | import pytest
from graphql import (
FloatValueNode,
GraphQLError,
GraphQLFloat,
GraphQLID,
GraphQLInputObjectType,
GraphQLInt,
GraphQLList,
GraphQLNonNull,
IntValueNode,
ListTypeNode,
NamedTypeNode,
NameNode,
NonNullTypeNode,
NullValueNode,
Undefined,
)
from g... | "...ABC" | assert | string_literal | tests/starwars/test_dsl.py | test_fragment_with_name_changed | 762 | null | |
graphql-python/gql | import pytest
from graphql import (
FloatValueNode,
GraphQLError,
GraphQLFloat,
GraphQLID,
GraphQLInputObjectType,
GraphQLInt,
GraphQLList,
GraphQLNonNull,
IntValueNode,
ListTypeNode,
NamedTypeNode,
NameNode,
NonNullTypeNode,
NullValueNode,
Undefined,
)
from g... | expected | assert | variable | tests/starwars/test_dsl.py | test_hero_name_query_result | 439 | null | |
graphql-python/gql | import asyncio
import json
from unittest.mock import AsyncMock, patch
import pytest
from gql import Client, gql
from gql.graphql_request import GraphQLRequest
from gql.transport.exceptions import (
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
TransportServerError,
)
pytestmark ... | 0 | assert | numeric_literal | tests/test_aiohttp_multipart.py | test_aiohttp_multipart_malformed_json | 366 | null | |
graphql-python/gql | import asyncio
import json
import logging
import os
import pathlib
import platform
import re
import ssl
import sys
import tempfile
import types
from concurrent.futures import ThreadPoolExecutor
from typing import Callable, Iterable, List, Union, cast
import pytest
import pytest_asyncio
from _pytest.fixtures import Sub... | v | assert | variable | tests/conftest.py | single_upload_handler | 790 | null | |
graphql-python/gql | import os
from contextlib import suppress
from typing import Any
from unittest import mock
import pytest
from graphql import ExecutionResult, build_ast_schema, parse
from gql import Client, GraphQLRequest, gql
from gql.transport import Transport
from gql.transport.exceptions import TransportQueryError
def http_trans... | Exception) | pytest.raises | variable | tests/test_client.py | test_retries_on_transport | 89 | null | |
graphql-python/gql | import asyncio
import json
import sys
from typing import Any, Dict, Mapping
import pytest
from gql import Client, gql
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportConnectionFailed,
TransportQueryError,
TransportServerError,
)
from .conftest import MS, WebSocketServerHelp... | 0 | assert | numeric_literal | tests/test_aiohttp_websocket_query.py | test_aiohttp_websocket_using_cli | 677 | null | |
graphql-python/gql | from typing import Mapping
import pytest
from gql import Client, GraphQLRequest
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
)
pytestmark = pytest.mark.httpx
query1_str = """
query getContinents {
continents {
code
name
... | "test1234" | assert | string_literal | tests/test_httpx_batch.py | test_httpx_async_batch_query | 73 | null | |
graphql-python/gql | import os
from contextlib import suppress
from typing import Any
from unittest import mock
import pytest
from graphql import ExecutionResult, build_ast_schema, parse
from gql import Client, GraphQLRequest, gql
from gql.transport import Transport
from gql.transport.exceptions import TransportQueryError
def http_trans... | None | assert | none_literal | tests/test_client.py | test_gql | 230 | null | |
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .conftest import MS, WebSocketServerHelp... | 5 | assert | numeric_literal | tests/test_aiohttp_websocket_graphqlws_subscription.py | test_aiohttp_websocket_graphqlws_subscription_break | 277 | null | |
graphql-python/gql | import pytest
mock_transport_host = "appsyncapp.awsgateway.com.example.org"
mock_transport_url = f"https://{mock_transport_host}/graphql"
@pytest.mark.botocore
def test_appsync_init_with_iam_auth_and_no_region(
caplog, fake_credentials_factory, fake_session_factory
):
"""
WARNING: this test will fail if:... | NoRegionError) | pytest.raises | variable | tests/test_appsync_auth.py | test_appsync_init_with_iam_auth_and_no_region | 122 | null | |
graphql-python/gql | from typing import Any, Dict, Optional
import pytest
from graphql import (
GraphQLArgument,
GraphQLError,
GraphQLField,
GraphQLFloat,
GraphQLInt,
GraphQLNonNull,
GraphQLObjectType,
GraphQLScalarType,
GraphQLSchema,
)
from graphql.language import ValueNode
from graphql.utilities impo... | GraphQLError) | pytest.raises | variable | tests/custom_scalars/test_json.py | test_none_json_value_input_in_dsl_argument | 215 | null | |
graphql-python/gql | import asyncio
from typing import Mapping
import pytest
from gql import Client, GraphQLRequest, gql
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
TransportServerError,
)
pytestmark = pytest.mark.aiohttp
query1_str = """
query getContinents {... | "AF" | assert | string_literal | tests/test_aiohttp_batch.py | test_aiohttp_batch_query | 84 | null | |
graphql-python/gql | import asyncio
import json
import pytest
from parse import search
from gql import Client, gql
pytestmark = pytest.mark.websockets
test_channel = "test_channel"
test_subscription_id = "test_subscription"
channel_leave_reply_template = (
"{{"
'"topic":"{channel_name}",'
'"event":"phx_reply",'
'"paylo... | count | assert | variable | tests/test_phoenix_channel_subscription.py | test_phoenix_channel_subscription | 208 | null | |
graphql-python/gql | import asyncio
import json
import types
from typing import List
import pytest
from gql import Client, gql
from gql.transport.exceptions import (
TransportConnectionFailed,
TransportProtocolError,
TransportQueryError,
)
from .conftest import MS, WebSocketServerHelper
pytestmark = [pytest.mark.aiohttp, py... | asyncio.TimeoutError) | pytest.raises | complex_expr | tests/test_aiohttp_websocket_exceptions.py | test_aiohttp_websocket_server_does_not_send_ack | 123 | null | |
graphql-python/gql | import asyncio
import json
import pytest
from parse import search
from gql import Client, gql
pytestmark = pytest.mark.websockets
test_channel = "test_channel"
test_subscription_id = "test_subscription"
channel_leave_reply_template = (
"{{"
'"topic":"{channel_name}",'
'"event":"phx_reply",'
'"paylo... | i | assert | variable | tests/test_phoenix_channel_subscription.py | test_phoenix_channel_heartbeat | 387 | null | |
graphql-python/gql | import io
import json
from typing import Any, Dict, Mapping
import pytest
from gql import Client, FileVar, gql
from gql.cli import get_parser, main
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
TransportQueryEr... | 1 | assert | numeric_literal | tests/test_httpx_async.py | test_httpx_using_cli_invalid_param | 1,030 | null | |
graphql-python/gql | import asyncio
import json
from base64 import b64decode
from typing import List
from urllib import parse
import pytest
from gql import Client, gql
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.websockets
SEND_MESSAGE_DELAY = 20 * MS
NB_MESSAGES = 10
DUMMY_API_KEY = "da2-thisisadummyapik... | "start" | assert | string_literal | tests/test_appsync_websockets.py | realtime_appsync_server_template | 185 | null | |
graphql-python/gql | import asyncio
import json
import sys
from typing import Any, Dict, Mapping
import pytest
from gql import Client, gql
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportConnectionFailed,
TransportQueryError,
TransportServerError,
)
from .conftest import MS, WebSocketServerHelp... | {} | assert | collection | tests/test_aiohttp_websocket_query.py | test_aiohttp_websocket_starting_client_in_context_manager | 67 | null | |
graphql-python/gql | import asyncio
import pytest
from graphql import ExecutionResult, GraphQLError, subscribe
from gql import Client, gql
from .fixtures import reviews
from .schema import StarWarsSchema
subscription_str = """
subscription ListenEpisodeReviews($ep: Episode!) {
reviewAdded(episode: $ep) {
stars,
... | expected | assert | variable | tests/starwars/test_subscription.py | test_subscription_support | 49 | null | |
graphql-python/gql | from typing import Mapping
import pytest
from gql import Client, GraphQLRequest, gql
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
TransportServerError,
)
pytestmark = pytest.mark.requests
query1_str = """
query getContinents {
contine... | "AF" | assert | string_literal | tests/test_requests_batch.py | test_code | 83 | null | |
graphql-python/gql | import asyncio
import json
import sys
import warnings
from typing import List
import pytest
from graphql import ExecutionResult
from parse import search
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.exceptions import TransportConnectionFailed, TransportServerError
from .con... | None | assert | none_literal | tests/test_aiohttp_websocket_subscription.py | test_aiohttp_websocket_subscription_get_execution_result | 232 | null | |
graphql-python/gql | import asyncio
import json
import sys
from typing import Any, Dict, Mapping
import pytest
from gql import Client, gql
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportConnectionFailed,
TransportQueryError,
TransportServerError,
)
from .conftest import MS, WebSocketServerHelp... | False | assert | bool_literal | tests/test_aiohttp_websocket_query.py | test_aiohttp_websocket_starting_client_in_context_manager | 93 | null | |
graphql-python/gql | import asyncio
import json
from base64 import b64decode
from typing import List
from urllib import parse
import pytest
from gql import Client, gql
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.websockets
SEND_MESSAGE_DELAY = 20 * MS
NB_MESSAGES = 10
DUMMY_API_KEY = "da2-thisisadummyapik... | "e30=" | assert | string_literal | tests/test_appsync_websockets.py | realtime_appsync_server_template | 155 | null | |
graphql-python/gql | import pytest
mock_transport_host = "appsyncapp.awsgateway.com.example.org"
mock_transport_url = f"https://{mock_transport_host}/graphql"
@pytest.mark.websockets
def test_appsync_init_with_jwt_auth():
from gql.transport.appsync_auth import AppSyncJWTAuthentication
from gql.transport.appsync_websockets import ... | auth | assert | variable | tests/test_appsync_auth.py | test_appsync_init_with_jwt_auth | 50 | null | |
graphql-python/gql | import asyncio
import logging
from typing import Dict
import pytest
from gql import Client, gql
from gql.transport.exceptions import TransportError, TransportQueryError
from .conftest import MS
pytestmark = pytest.mark.websockets
logging.basicConfig(level=logging.INFO)
skip_reason = (
"backend does not suppor... | "Africa" | assert | string_literal | tests/test_websocket_online.py | query_task2 | 256 | null | |
graphql-python/gql | import asyncio
import json
import logging
import os
import pathlib
import platform
import re
import ssl
import sys
import tempfile
import types
from concurrent.futures import ThreadPoolExecutor
from typing import Callable, Iterable, List, Union, cast
import pytest
import pytest_asyncio
from _pytest.fixtures import Sub... | WSMsgType.TEXT | assert | complex_expr | tests/conftest.py | default_server_handler | AIOHTTPWebsocketServer | 273 | null |
graphql-python/gql | from typing import Mapping
import pytest
from gql import Client, GraphQLRequest, gql
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
TransportServerError,
)
pytestmark = pytest.mark.requests
query1_str = """
query getContinents {
contine... | request.headers | assert | complex_expr | tests/test_requests_batch.py | handler | 210 | null | |
graphql-python/gql | import io
import json
from typing import Any, Dict, Mapping
import pytest
from gql import Client, FileVar, gql
from gql.cli import get_parser, main
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
TransportQueryEr... | 0 | assert | numeric_literal | tests/test_httpx_async.py | test_httpx_using_cli | 954 | null | |
graphql-python/gql | import asyncio
import json
from base64 import b64decode
from typing import List
from urllib import parse
import pytest
from gql import Client, gql
from .conftest import MS, WebSocketServerHelper
pytestmark = pytest.mark.websockets
SEND_MESSAGE_DELAY = 20 * MS
NB_MESSAGES = 10
DUMMY_API_KEY = "da2-thisisadummyapik... | "/graphql" | assert | string_literal | tests/test_appsync_websockets.py | realtime_appsync_server_template | 148 | null | |
graphql-python/gql | import asyncio
from typing import Mapping
import pytest
from gql import Client, GraphQLRequest, gql
from gql.transport.exceptions import (
TransportClosed,
TransportProtocolError,
TransportQueryError,
TransportServerError,
)
pytestmark = pytest.mark.aiohttp
query1_str = """
query getContinents {... | TransportQueryError) | pytest.raises | variable | tests/test_aiohttp_batch.py | test_aiohttp_batch_error_code | 335 | null | |
graphql-python/gql | import pytest
mock_transport_host = "appsyncapp.awsgateway.com.example.org"
mock_transport_url = f"https://{mock_transport_host}/graphql"
@pytest.mark.botocore
def test_munge_url(fake_signer_factory, fake_request_factory):
from gql.transport.appsync_auth import AppSyncIAMAuthentication
from gql.transport.apps... | expected_url | assert | variable | tests/test_appsync_auth.py | test_munge_url | 167 | null | |
graphql-python/gql | from enum import Enum
from typing import Optional
import pytest
from graphql import (
GraphQLArgument,
GraphQLEnumType,
GraphQLField,
GraphQLList,
GraphQLNamedType,
GraphQLNonNull,
GraphQLObjectType,
GraphQLSchema,
)
from gql import Client, gql
from gql.utilities import update_schema_e... | str(exc_info) | assert | func_call | tests/custom_scalars/test_enum_colors.py | test_update_schema_enum_errors | 285 | null | |
graphql-python/gql | import io
import json
import os
import warnings
from typing import Mapping
import pytest
from gql import Client, FileVar, gql
from gql.cli import get_parser, main
from gql.transport.exceptions import (
TransportAlreadyConnected,
TransportClosed,
TransportConnectionFailed,
TransportProtocolError,
T... | "AF" | assert | string_literal | tests/test_aiohttp.py | test_aiohttp_reconnecting_session | 1,568 | null | |
microsoft/onnxscript | from __future__ import annotations
import unittest
import numpy as np
import onnx_ir as ir
import onnx_ir.passes.common.shape_inference as shape_inference
import onnxruntime as ort
import onnxscript
import onnxscript.optimizer
from onnxscript import FLOAT, INT32, script
from onnxscript import opset18 as op
from onnx... | len(source_model_outputs)) | self.assertEqual | func_call | onnxscript/rewriter/ort_fusions/gqa_packed_qkv_test.py | test_fuse_packed_qkv_for_gqa | PackedQKVforGQAFusionTest | 136 | null |
microsoft/onnxscript | import unittest
import numpy as np
from onnxscript import script
from onnxscript.onnx_opset import opset15 as op
from onnxscript.onnx_types import FLOAT, INT64
from tests.common import testutils
class LoopOpTest(testutils.TestBase):
def test_loop(self):
"""Basic loop test."""
@script()
d... | np.array([16])) | self.assertEqual | func_call | tests/loop_test.py | test_loop | LoopOpTest | 31 | null |
microsoft/onnxscript | from __future__ import annotations
import unittest
from typing import Any, Tuple
import numpy as np
import onnx
import onnx.reference
import onnx.reference.op_run
import onnx_ir.passes.common as common_passes
import parameterized
import onnxscript.rewriter.ort_fusions.fused_matmul_rule_sets as fused_matmul_rule_sets... | len(expected)) | self.assertEqual | func_call | onnxscript/rewriter/ort_fusions/fused_matmul_rule_sets_test.py | _check_model | TestFusedMatmulRules | 287 | null |
microsoft/onnxscript | from __future__ import annotations
import inspect
import typing
import unittest
import onnxscript
from onnxscript._internal import values
class TracedOnnxFunctionTest(unittest.TestCase):
def test_init(self):
def function(input1, input2, attr1: int, attr2: int = 1):
return input1 + input2 + at... | opset) | self.assertEqual | variable | onnxscript/_internal/values_test.py | test_init | TracedOnnxFunctionTest | 20 | null |
microsoft/onnxscript | from __future__ import annotations
import dataclasses
import importlib
import os
import pathlib
import re
import sys
import unittest
from typing import Pattern
import onnx
import onnxruntime as ort
import parameterized
from onnxruntime.capi import onnxruntime_pybind11_state
import onnxscript
import onnxscript.testin... | code) | self.assertIn | variable | onnxscript/backend/onnx_export_test.py | test_export2python | TestOnnxBackEnd | 221 | null |
microsoft/onnxscript | from __future__ import annotations
import unittest
from typing import Any
import onnx_ir as ir
from onnxscript._internal.builder import GraphBuilder, OpBuilder
from onnxscript.nn import Module, ModuleList, Parameter, Sequential
def _create_graph_and_op() -> tuple[ir.Graph, OpBuilder]:
"""Create an empty graph a... | 3) | self.assertEqual | numeric_literal | onnxscript/nn/_module_test.py | test_basic_indexing | ModuleListTest | 679 | null |
microsoft/onnxscript | import unittest
from onnxscript.rewriter import _pattern_ir
class PatternIRTest(unittest.TestCase):
def test_to_value_pattern_with_callable(self):
"""Test _to_value_pattern function with callable input."""
def my_checker(context, value):
return True
result = _pattern_ir._to_... | result.name) | self.assertIsNone | complex_expr | onnxscript/rewriter/_pattern_ir_test.py | test_to_value_pattern_with_callable | PatternIRTest | 55 | null |
microsoft/onnxscript | from __future__ import annotations
import unittest
from typing import Any, Tuple
import numpy as np
import onnx
import onnx.reference
import onnx.reference.op_run
import onnx_ir.passes.common as common_passes
import parameterized
import onnxscript.rewriter.ort_fusions.fused_matmul_rule_sets as fused_matmul_rule_sets... | len(B.shape) | assert | func_call | onnxscript/rewriter/ort_fusions/fused_matmul_rule_sets_test.py | _run | FusedMatMul | 40 | null |
microsoft/onnxscript | from __future__ import annotations
import unittest
from typing import Any
import onnx_ir as ir
from onnxscript._internal.builder import GraphBuilder, OpBuilder
from onnxscript.nn import Module, ModuleList, Parameter, Sequential
def _create_graph_and_op() -> tuple[ir.Graph, OpBuilder]:
"""Create an empty graph a... | p) | self.assertIs | variable | onnxscript/nn/_module_test.py | test_realize_creates_initializer | ParameterTest | 39 | null |
microsoft/onnxscript | from __future__ import annotations
import unittest
from onnxscript import ir
from onnxscript.ir import _tape
class TestTape(unittest.TestCase):
def test_op_multi_out(self):
inputs = [
ir.Value(
name="input_a", type=ir.TensorType(ir.DataType.FLOAT), shape=ir.Shape((1, 2))
... | ["SomeOp", "SomeOtherOp"]) | self.assertEqual | collection | onnxscript/ir/_tape_test.py | test_op_multi_out | TestTape | 73 | null |
microsoft/onnxscript | import os
import textwrap
from typing import Iterator
import numpy as np
import onnx
import onnx.numpy_helper
from onnx.backend.test import __file__ as backend_folder
from onnxscript.backend import onnx_export
def assert_almost_equal_string(expected, value):
"""Compares two arrays knowing they contain strings.
... | o) | assert_* | variable | onnxscript/backend/onnx_backend.py | _compare_results | OnnxBackendTest | 166 | null |
microsoft/onnxscript | from __future__ import annotations
import unittest
import onnx
import onnx_ir as ir
from packaging.version import Version
from parameterized import parameterized
import onnxscript
import onnxscript.rewriter.testing
from onnxscript.rewriter.models import _rotary_embedding_models
from onnxscript.rewriter.rules.fusion ... | op_types) | self.assertIn | variable | onnxscript/rewriter/rules/fusion/_rotary_embedding_test.py | test_rotary_embedding_fusion | RotaryEmbeddingOnnxFusionTest | 39 | null |
microsoft/onnxscript | from __future__ import annotations
import unittest
from onnxscript import ir
from onnxscript.ir import _tape
class TestTape(unittest.TestCase):
def test_op(self):
# Create a simple ONNX model with shape inference
# Define the model
inputs = [
ir.Value(
name="in... | ["Add"]) | self.assertEqual | collection | onnxscript/ir/_tape_test.py | test_op | TestTape | 28 | null |
microsoft/onnxscript | import unittest
import numpy as np
import onnx.parser
from onnxscript import ir
from onnxscript.rewriter.ort_fusions import instance_to_group_normalization
class ReplaceInstanceNormWithGroupNormTest(unittest.TestCase):
def _set_up_model_initializers(
self,
model,
weight_for_norm_value,
... | 0) | self.assertEqual | numeric_literal | onnxscript/rewriter/ort_fusions/instance_to_group_normalization_test.py | test_instance_norm_with_non_one_weight_for_norm_should_remain | ReplaceInstanceNormWithGroupNormTest | 129 | null |
microsoft/onnxscript | import collections
import unittest
import parameterized
from onnxscript import ir
from onnxscript._internal import param_manipulation
TEST_INPUT = "TEST_INPUT"
class TestSeparateInputAttributesFromArguments(unittest.TestCase):
@parameterized.parameterized.expand(
[
(
"all_po... | len(expected_inputs)) | self.assertEqual | func_call | onnxscript/_internal/param_manipulation_test.py | test_it_is_correct_on | TestSeparateInputAttributesFromArguments | 101 | null |
microsoft/onnxscript | import os
import sys
import time
import unittest
import numpy as np
import torch
import onnxscript.tools.memory_peak
class TestMemoryPeak(unittest.TestCase):
@unittest.skipIf(sys.platform == "win32", reason="other test are failing")
def test_memory(self):
mem = onnxscript.tools.memory_peak.get_memory... | int) | self.assertIsInstance | variable | onnxscript/tools/memory_peak_test.py | test_memory | TestMemoryPeak | 18 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.