Skip to content

Commit 0bf55be

Browse files
committed
Reformat with latest black version (18.9b0)
1 parent 57dc814 commit 0bf55be

16 files changed

+25
-18
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ install:
1212
- pipenv install --dev
1313

1414
script:
15+
- flake8 --version
1516
- flake8 graphql tests
17+
- black --version
1618
- black graphql tests --check
19+
- mypy --version
1720
- mypy graphql
21+
- pytest --version
1822
- pytest --cov-report term-missing --cov=graphql
1923

2024
after_success:

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ name = "pypi"
55

66
[dev-packages]
77
graphql-core-next = {path = ".", editable = true}
8-
# Line below commented as causes issues with Pipenv
9-
# black = "18.6b4"
8+
# black = "*"
109
flake8 = "*"
1110
mypy = "*"
1211
pytest = "*"
@@ -17,3 +16,4 @@ sphinx = "*"
1716
sphinx_rtd_theme = "*"
1817
python-coveralls = "*"
1918
pytest-cov = "*"
19+

graphql/type/scalars.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
# n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because
2929
# they are internally represented as IEEE 754 doubles,
3030
# while Python's integers may be arbitrarily large.
31-
MAX_INT = 2147483647
32-
MIN_INT = -2147483648
31+
MAX_INT = 2_147_483_647
32+
MIN_INT = -2_147_483_648
3333

3434

3535
def serialize_int(value: Any) -> int:

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"pytest-asyncio",
3838
"pytest-cov",
3939
"pytest-describe",
40+
"black",
4041
"flake8",
4142
"mypy",
4243
"tox",

tests/subscription/test_map_async_iterator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ async def source():
260260

261261
# Make sure it is blocked
262262
doubles_future = ensure_future(anext(doubles))
263-
await sleep(.05)
263+
await sleep(0.05)
264264
assert not doubles_future.done()
265265

266266
# Unblock and watch StopAsyncIteration propagate
267267
await doubles.aclose()
268-
await sleep(.05)
268+
await sleep(0.05)
269269
assert doubles_future.done()
270270
assert isinstance(doubles_future.exception(), StopAsyncIteration)
271271

tests/type/test_introspection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
)
1414
from graphql.utilities import get_introspection_query
1515
from graphql.validation.rules.provided_required_arguments import (
16-
missing_field_arg_message
16+
missing_field_arg_message,
1717
)
1818

1919

tests/utilities/test_coerce_value.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,16 @@ def returns_a_single_error_for_string_input():
164164
]
165165

166166
def describe_for_graphql_enum():
167-
TestEnum = GraphQLEnumType("TestEnum", {"FOO": "InternalFoo", "BAR": 123456789})
167+
TestEnum = GraphQLEnumType(
168+
"TestEnum", {"FOO": "InternalFoo", "BAR": 123_456_789}
169+
)
168170

169171
def returns_no_error_for_a_known_enum_name():
170172
foo_result = coerce_value("FOO", TestEnum)
171173
assert expect_value(foo_result) == "InternalFoo"
172174

173175
bar_result = coerce_value("BAR", TestEnum)
174-
assert expect_value(bar_result) == 123456789
176+
assert expect_value(bar_result) == 123_456_789
175177

176178
def results_error_for_misspelled_enum_value():
177179
result = coerce_value("foo", TestEnum)

tests/validation/test_executable_definitions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from graphql.validation import ExecutableDefinitionsRule
22
from graphql.validation.rules.executable_definitions import (
3-
non_executable_definitions_message
3+
non_executable_definitions_message,
44
)
55

66
from .harness import expect_fails_rule, expect_passes_rule

tests/validation/test_lone_anonymous_operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from graphql.validation import LoneAnonymousOperationRule
22
from graphql.validation.rules.lone_anonymous_operation import (
3-
anonymous_operation_not_alone_message
3+
anonymous_operation_not_alone_message,
44
)
55

66
from .harness import expect_fails_rule, expect_passes_rule

tests/validation/test_overlapping_fields_can_be_merged.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)
1212
from graphql.validation import OverlappingFieldsCanBeMergedRule
1313
from graphql.validation.rules.overlapping_fields_can_be_merged import (
14-
fields_conflict_message
14+
fields_conflict_message,
1515
)
1616

1717
from .harness import (

tests/validation/test_single_field_subscriptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from graphql.validation import SingleFieldSubscriptionsRule
22
from graphql.validation.rules.single_field_subscriptions import (
3-
single_field_only_message
3+
single_field_only_message,
44
)
55

66
from .harness import expect_fails_rule, expect_passes_rule

tests/validation/test_unique_directives_per_location.py

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

33
from graphql.validation import UniqueDirectivesPerLocationRule
44
from graphql.validation.rules.unique_directives_per_location import (
5-
duplicate_directive_message
5+
duplicate_directive_message,
66
)
77

88
from .harness import expect_fails_rule, expect_passes_rule, expect_sdl_errors_from_rule

tests/validation/test_unique_fragment_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from graphql.validation import UniqueFragmentNamesRule
22
from graphql.validation.rules.unique_fragment_names import (
3-
duplicate_fragment_name_message
3+
duplicate_fragment_name_message,
44
)
55

66
from .harness import expect_fails_rule, expect_passes_rule

tests/validation/test_unique_input_field_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from graphql.validation import UniqueInputFieldNamesRule
22
from graphql.validation.rules.unique_input_field_names import (
3-
duplicate_input_field_message
3+
duplicate_input_field_message,
44
)
55

66
from .harness import expect_fails_rule, expect_passes_rule

tests/validation/test_unique_operation_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from graphql.validation import UniqueOperationNamesRule
22
from graphql.validation.rules.unique_operation_names import (
3-
duplicate_operation_name_message
3+
duplicate_operation_name_message,
44
)
55

66
from .harness import expect_fails_rule, expect_passes_rule

tests/validation/test_variables_are_input_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from graphql.validation import VariablesAreInputTypesRule
22
from graphql.validation.rules.variables_are_input_types import (
3-
non_input_type_on_var_message
3+
non_input_type_on_var_message,
44
)
55

66
from .harness import expect_fails_rule, expect_passes_rule

0 commit comments

Comments
 (0)