Skip to content

Commit a53ddfb

Browse files
committed
Install pytest while running mypy
To avoid mypy warnings, since we run mypy over the tests, and the tests import from pytest.
1 parent a9ae0d9 commit a53ddfb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+52
-50
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pytest configuration
22

3-
import pytest # type: ignore
3+
import pytest
44

55

66
def pytest_addoption(parser):

tests/error/test_format_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import List, Union
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.error import GraphQLError, format_error
66
from graphql.language import Node, Source

tests/execution/test_abstract_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import NamedTuple
22

3-
from pytest import mark # type: ignore
3+
from pytest import mark
44

55
from graphql import graphql
66
from graphql.type import (

tests/execution/test_execution_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pytest import raises # type: ignore
1+
from pytest import raises
22

33
from graphql.error import GraphQLError
44
from graphql.execution import ExecutionResult

tests/execution/test_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
from typing import cast, Any, Awaitable, Optional
33

4-
from pytest import raises, mark # type: ignore
4+
from pytest import mark, raises
55

66
from graphql.error import GraphQLError
77
from graphql.execution import execute, execute_sync

tests/execution/test_lists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any
22

3-
from pytest import mark # type: ignore
3+
from pytest import mark
44

55
from graphql.execution import execute, execute_sync, ExecutionResult
66
from graphql.language import parse

tests/execution/test_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Awaitable
22

3-
from pytest import mark, raises # type: ignore
3+
from pytest import mark, raises
44

55
from graphql.execution import MiddlewareManager, execute
66
from graphql.language.parser import parse

tests/execution/test_mutations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
from typing import Awaitable
33

4-
from pytest import mark # type: ignore
4+
from pytest import mark
55

66
from graphql.execution import execute, execute_sync
77
from graphql.language import parse

tests/execution/test_nonnull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import re
22
from typing import Any, Awaitable, cast
33

4-
from pytest import mark # type: ignore
4+
from pytest import mark
55

66
from graphql.execution import execute, execute_sync, ExecutionResult
77
from graphql.language import parse

tests/execution/test_parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
from typing import Awaitable
33

4-
from pytest import mark # type: ignore
4+
from pytest import mark
55

66
from graphql.execution import execute
77
from graphql.language import parse

tests/execution/test_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from inspect import isawaitable
33
from typing import Awaitable, cast
44

5-
from pytest import mark, raises # type: ignore
5+
from pytest import mark, raises
66

77
from graphql import graphql_sync
88
from graphql.execution import execute, execute_sync

tests/fixtures/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
from os.path import dirname, join
44

5-
from pytest import fixture # type: ignore
5+
from pytest import fixture
66

77
__all__ = [
88
"kitchen_sink_query",

tests/language/test_block_string_fuzz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pytest import mark # type: ignore
3+
from pytest import mark
44

55
from graphql.error import GraphQLSyntaxError
66
from graphql.language import Source, Lexer, TokenKind

tests/language/test_lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import List, Optional, Tuple
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.error import GraphQLSyntaxError
66
from graphql.language import Lexer, Source, SourceLocation, Token, TokenKind

tests/language/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import cast, Optional, Tuple
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.error import GraphQLSyntaxError
66
from graphql.language import (

tests/language/test_printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from copy import deepcopy
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.language import FieldNode, NameNode, parse, print_ast
66

tests/language/test_schema_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from textwrap import dedent
22
from typing import List, Optional, Tuple
33

4-
from pytest import raises # type: ignore
4+
from pytest import raises
55

66
from graphql.error import GraphQLSyntaxError
77
from graphql.language import (

tests/language/test_schema_printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from copy import deepcopy
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.language import ScalarTypeDefinitionNode, NameNode, print_ast, parse
66

tests/language/test_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import cast, Tuple
44

5-
from pytest import raises # type: ignore
5+
from pytest import raises
66

77
from graphql.language import Source, SourceLocation
88

tests/language/test_visitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from functools import partial
33
from typing import cast, Dict, List, Optional, Tuple
44

5-
from pytest import mark, raises # type: ignore
5+
from pytest import mark, raises
66

77
from graphql.language import (
88
Node,

tests/pyutils/test_description.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from contextlib import contextmanager
22
from typing import cast
33

4-
from pytest import raises # type: ignore
4+
from pytest import raises
55

66
from graphql import graphql_sync
77
from graphql.type import (

tests/pyutils/test_event_emitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from asyncio import sleep
22

3-
from pytest import mark, raises # type: ignore
3+
from pytest import mark, raises
44

55
from graphql.pyutils import EventEmitter, EventEmitterAsyncIterator
66

tests/pyutils/test_frozen_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from copy import copy, deepcopy
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.pyutils import FrozenError, FrozenDict
66

tests/pyutils/test_frozen_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from copy import copy, deepcopy
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.pyutils import FrozenError, FrozenList
66

tests/pyutils/test_inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from importlib import import_module
44
from typing import Any, Dict, FrozenSet, List, Set, Tuple
55

6-
from pytest import mark # type: ignore
6+
from pytest import mark
77

88
from graphql.pyutils import inspect, Undefined
99
from graphql.type import (

tests/pyutils/test_is_awaitable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
from inspect import isawaitable
33

4-
from pytest import mark # type: ignore
4+
from pytest import mark
55

66
from graphql.pyutils import is_awaitable
77

tests/subscription/test_map_async_iterator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from asyncio import Event, ensure_future, sleep
33

4-
from pytest import mark, raises # type: ignore
4+
from pytest import mark, raises
55

66
from graphql.subscription.map_async_iterator import MapAsyncIterator
77

tests/subscription/test_subscribe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import Any, Dict, Optional, Callable
44

5-
from pytest import mark, raises # type: ignore
5+
from pytest import mark, raises
66

77
from graphql.language import parse, DocumentNode
88
from graphql.pyutils import EventEmitter, EventEmitterAsyncIterator

tests/test_star_wars_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pytest import mark # type: ignore
1+
from pytest import mark
22

33
from graphql import graphql, graphql_sync
44

tests/test_user_registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from enum import Enum
99
from typing import Any, Dict, List, NamedTuple, Optional
1010

11-
from pytest import fixture, mark # type: ignore
11+
from pytest import fixture, mark
1212

1313
from graphql import (
1414
graphql,

tests/type/test_definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from math import isnan, nan
22
from typing import cast
33

4-
from pytest import mark, raises # type: ignore
4+
from pytest import mark, raises
55

66
from graphql.error import GraphQLError
77
from graphql.language import (

tests/type/test_directives.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pytest import raises # type: ignore
1+
from pytest import raises
22

33
from graphql.language import DirectiveLocation, DirectiveDefinitionNode, Node
44
from graphql.type import GraphQLArgument, GraphQLDirective, GraphQLInt, GraphQLString

tests/type/test_extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any, Dict, cast
22

3-
from pytest import mark, param, raises # type: ignore
3+
from pytest import mark, param, raises
44

55
from graphql.type import (
66
GraphQLArgument,

tests/type/test_predicate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.language import DirectiveLocation
66
from graphql.type import (

tests/type/test_scalars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from math import inf, nan, pi
22
from typing import Any
33

4-
from pytest import raises # type: ignore
4+
from pytest import raises
55

66
from graphql.error import GraphQLError
77
from graphql.language import parse_value as parse_value_to_ast

tests/type/test_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from copy import deepcopy
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.language import (
66
DirectiveLocation,

tests/type/test_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from operator import attrgetter
22
from typing import Any, List, Union
33

4-
from pytest import mark, raises # type: ignore
4+
from pytest import mark, raises
55

66
from graphql.language import parse, DirectiveLocation
77
from graphql.pyutils import inspect

tests/utilities/test_assert_valid_name.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pytest import raises # type: ignore
1+
from pytest import raises
22

33
from graphql.error import GraphQLError
44
from graphql.utilities import assert_valid_name

tests/utilities/test_ast_from_value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from math import inf, nan
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql.error import GraphQLError
66
from graphql.language import (

tests/utilities/test_build_ast_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections import namedtuple
22
from typing import Union
33

4-
from pytest import raises # type: ignore
4+
from pytest import raises
55

66
from graphql import graphql_sync
77
from graphql.language import parse, print_ast, DocumentNode, InterfaceTypeDefinitionNode

tests/utilities/test_build_client_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pytest import raises # type: ignore
1+
from pytest import raises
22

33
from graphql import graphql_sync
44
from graphql.type import (

tests/utilities/test_coerce_input_value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from math import nan
22
from typing import Any, List, NamedTuple, Union
33

4-
from pytest import raises # type: ignore
4+
from pytest import raises
55

66
from graphql.error import GraphQLError
77
from graphql.pyutils import Undefined

tests/utilities/test_extend_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Union
22

3-
from pytest import raises # type: ignore
3+
from pytest import raises
44

55
from graphql import graphql_sync
66
from graphql.language import (

tests/utilities/test_get_operation_root_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pytest import raises # type: ignore
1+
from pytest import raises
22

33
from graphql.error import GraphQLError
44
from graphql.language import (

tests/utilities/test_strip_ignored_characters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from json import dumps
22
from typing import Optional
33

4-
from pytest import raises # type: ignore
4+
from pytest import raises
55

66
from graphql.error import GraphQLSyntaxError
77
from graphql.language import Lexer, Source, TokenKind, parse

tests/utilities/test_strip_ignored_characters_fuzz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional
22

3-
from pytest import mark # type: ignore
3+
from pytest import mark
44

55
from graphql.error import GraphQLSyntaxError
66
from graphql.language import Lexer, Source, TokenKind

tests/utilities/test_type_from_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pytest import raises # type: ignore
1+
from pytest import raises
22

33
from graphql.language import parse_type, TypeNode
44
from graphql.type import GraphQLList, GraphQLNonNull, GraphQLObjectType

tests/validation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Tests for graphql.validation"""
22

3-
from pytest import register_assert_rewrite # type: ignore
3+
from pytest import register_assert_rewrite
44

55
register_assert_rewrite("tests.validation.harness")

tests/validation/test_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pytest import raises # type: ignore
1+
from pytest import raises
22

33
from graphql.error import GraphQLError
44
from graphql.language import parse

0 commit comments

Comments
 (0)