Skip to content

Commit c46f4e7

Browse files
author
Daniel Gallagher
committed
Run pre-commit on all files to apply black formatting
1 parent 6d3a58c commit c46f4e7

Some content is hidden

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

46 files changed

+3
-127
lines changed

graphql/backend/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414

1515
class GraphQLBackend(six.with_metaclass(ABCMeta)):
16-
1716
@abstractmethod
1817
def document_from_string(self, schema, request_string):
1918
raise NotImplementedError(
@@ -22,7 +21,6 @@ def document_from_string(self, schema, request_string):
2221

2322

2423
class GraphQLDocument(object):
25-
2624
def __init__(self, schema, document_string, document_ast, execute):
2725
# type: (GraphQLSchema, str, Document, Callable) -> None
2826
self.schema = schema

graphql/backend/compiled.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99

1010
class GraphQLCompiledDocument(GraphQLDocument):
11-
1211
@classmethod
1312
def from_code(
1413
cls,

graphql/backend/quiver_cloud.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333

3434
class GraphQLQuiverCloudBackend(GraphQLBackend):
35-
3635
def __init__(self, dsn, python_options=None, **options):
3736
super(GraphQLQuiverCloudBackend, self).__init__(**options)
3837
try:
@@ -50,7 +49,7 @@ def __init__(self, dsn, python_options=None, **options):
5049
else:
5150
path = ""
5251

53-
self.api_url = "%s://%s%s" % (url.scheme.rsplit("+", 1)[-1], netloc, path)
52+
self.api_url = "{}://{}{}".format(url.scheme.rsplit("+", 1)[-1], netloc, path)
5453
self.public_key = url.username
5554
self.secret_key = url.password
5655
self.extra_namespace = {}

graphql/backend/tests/test_decider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818

1919
class FakeBackend(GraphQLBackend):
20-
2120
def __init__(self, name, raises=False):
2221
# type: (str, bool) -> None
2322
self.raises = raises

graphql/error/located_error.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
class GraphQLLocatedError(GraphQLError):
14-
1514
def __init__(
1615
self,
1716
nodes, # type: List[Field]

graphql/error/syntax_error.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class GraphQLSyntaxError(GraphQLError):
13-
1413
def __init__(self, source, position, description):
1514
# type: (Source, int, str) -> None
1615
location = get_location(source, position)

graphql/execution/executors/asyncio.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def asyncgen_to_observable(asyncgen, loop=None):
4545

4646

4747
class AsyncioExecutor(object):
48-
4948
def __init__(self, loop=None):
5049
# type: (Optional[_UnixSelectorEventLoop]) -> None
5150
if loop is None:

graphql/execution/executors/asyncio_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44

55

66
def asyncgen_to_observable(asyncgen, loop=None):
7-
87
def emit(observer):
98
task = ensure_future(iterate_asyncgen(asyncgen, observer), loop=loop)
109

1110
def dispose():
12-
1311
async def await_task():
1412
await task
1513

graphql/execution/executors/gevent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class GeventExecutor(object):
10-
1110
def __init__(self):
1211
self.jobs = []
1312

graphql/execution/executors/process.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ def queue_process(q):
1111

1212

1313
class ProcessExecutor(object):
14-
1514
def __init__(self):
1615
self.processes = []
1716
self.q = Queue()

graphql/execution/executors/sync.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class SyncExecutor(object):
7-
87
def wait_until_finished(self):
98
# type: () -> None
109
pass

graphql/execution/tests/test_abstract.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,20 @@
1111

1212

1313
class Dog(object):
14-
1514
def __init__(self, name, woofs):
1615
# type: (str, bool) -> None
1716
self.name = name
1817
self.woofs = woofs
1918

2019

2120
class Cat(object):
22-
2321
def __init__(self, name, meows):
2422
# type: (str, bool) -> None
2523
self.name = name
2624
self.meows = meows
2725

2826

2927
class Human(object):
30-
3128
def __init__(self, name):
3229
# type: (str) -> None
3330
self.name = name

graphql/execution/tests/test_dataloader.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def test_batches_correctly(executor):
6464
load_calls = []
6565

6666
class BusinessDataLoader(DataLoader):
67-
6867
def batch_load_fn(self, keys):
6968
# type: (List[str]) -> Promise
7069
load_calls.append(keys)
@@ -145,7 +144,6 @@ def test_batches_multiple_together(executor):
145144
business_load_calls = []
146145

147146
class BusinessDataLoader(DataLoader):
148-
149147
def batch_load_fn(self, keys):
150148
# type: (List[str]) -> Promise
151149
business_load_calls.append(keys)
@@ -154,7 +152,6 @@ def batch_load_fn(self, keys):
154152
location_load_calls = []
155153

156154
class LocationDataLoader(DataLoader):
157-
158155
def batch_load_fn(self, keys):
159156
# type: (List[str]) -> Promise
160157
location_load_calls.append(keys)

graphql/execution/tests/test_execute_schema.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def test_executes_using_a_schema():
7676
BlogSchema = GraphQLSchema(BlogQuery)
7777

7878
class Article(object):
79-
8079
def __init__(self, id):
8180
# type: (int) -> None
8281
self.id = id
@@ -101,7 +100,6 @@ def recentArticle(self):
101100
return Article(1)
102101

103102
class Pic(object):
104-
105103
def __init__(self, uid, width, height):
106104
# type: (int, int, int) -> None
107105
self.url = "cdn://{}".format(uid)

graphql/execution/tests/test_executor.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ def test_nulls_out_error_subtrees():
257257
}"""
258258

259259
class Data(object):
260-
261260
def ok(self):
262261
# type: () -> str
263262
return "ok"
@@ -499,13 +498,11 @@ def test_does_not_include_arguments_that_were_not_set():
499498
def test_fails_when_an_is_type_of_check_is_not_met():
500499
# type: () -> None
501500
class Special(object):
502-
503501
def __init__(self, value):
504502
# type: (str) -> None
505503
self.value = value
506504

507505
class NotSpecial(object):
508-
509506
def __init__(self, value):
510507
# type: (str) -> None
511508
self.value = value
@@ -597,7 +594,6 @@ def test_middleware():
597594
}"""
598595

599596
class Data(object):
600-
601597
def ok(self):
602598
# type: () -> str
603599
return "ok"
@@ -631,7 +627,6 @@ def test_middleware_class():
631627
}"""
632628

633629
class Data(object):
634-
635630
def ok(self):
636631
# type: () -> str
637632
return "ok"
@@ -648,7 +643,6 @@ def not_ok(self):
648643
)
649644

650645
class MyMiddleware(object):
651-
652646
def resolve(self, next, *args, **kwargs):
653647
# type: (Callable, *Any, **Any) -> Promise
654648
p = next(*args, **kwargs)
@@ -667,7 +661,6 @@ def test_middleware_skip_promise_wrap():
667661
}"""
668662

669663
class Data(object):
670-
671664
def ok(self):
672665
# type: () -> str
673666
return "ok"
@@ -684,13 +677,11 @@ def not_ok(self):
684677
)
685678

686679
class MyPromiseMiddleware(object):
687-
688680
def resolve(self, next, *args, **kwargs):
689681
# type: (Callable, *Any, **Any) -> Promise
690682
return Promise.resolve(next(*args, **kwargs))
691683

692684
class MyEmptyMiddleware(object):
693-
694685
def resolve(self, next, *args, **kwargs):
695686
# type: (Callable, *Any, **Any) -> str
696687
return next(*args, **kwargs)
@@ -777,7 +768,6 @@ def test_executor_properly_propogates_path_data(mocker):
777768
BlogSchema = GraphQLSchema(BlogQuery)
778769

779770
class Article(object):
780-
781771
def __init__(self, id):
782772
# type: (int) -> None
783773
self.id = id
@@ -800,14 +790,12 @@ def recentArticle(self):
800790
return Article(1)
801791

802792
class Pic(object):
803-
804793
def __init__(self, uid, width, height):
805794
self.url = "cdn://{}".format(uid)
806795
self.width = str(width)
807796
self.height = str(height)
808797

809798
class PathCollectorMiddleware(object):
810-
811799
def __init__(self):
812800
# type: () -> None
813801
self.paths = []

graphql/execution/tests/test_executor_gevent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020

2121
def test_gevent_executor():
22-
2322
def resolver(context, *_):
2423
gevent.sleep(0.001)
2524
return "hey"

graphql/execution/tests/test_executor_thread.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ def test_synchronous_error_nulls_out_error_subtrees():
175175
)
176176

177177
class Data:
178-
179178
def sync(self):
180179
# type: () -> str
181180
return "sync"

graphql/execution/tests/test_lists.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121

2222
def check(test_data, expected):
23-
2423
def run_check(self):
2524
# type: (Any) -> None
2625
test_type = self.type

graphql/execution/tests/test_mutations.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717

1818

1919
class NumberHolder(object):
20-
2120
def __init__(self, n):
2221
# type: (int) -> None
2322
self.theNumber = n
2423

2524

2625
class Root(object):
27-
2826
def __init__(self, n):
2927
# type: (int) -> None
3028
self.numberHolder = NumberHolder(n)

graphql/execution/tests/test_nonnull.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525

2626
class ThrowingData(object):
27-
2827
def sync(self):
2928
# type: () -> None
3029
raise sync_error
@@ -59,7 +58,6 @@ def nonNullPromiseNest(self):
5958

6059

6160
class NullingData(object):
62-
6361
def sync(self):
6462
# type: () -> Optional[Any]
6563
return None

graphql/execution/tests/test_resolve.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727

2828
class CustomPromise(Promise):
29-
3029
@classmethod
3130
def fulfilled(cls, x):
3231
# type: (str) -> CustomPromise

graphql/execution/tests/test_subscribe.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ def default_resolver(root, info):
114114

115115

116116
class MyObserver(Observer):
117-
118117
def on_next(self, value):
119118
self.has_on_next = value
120119

@@ -133,7 +132,6 @@ def create_subscription(
133132
):
134133
# type: (...) -> Tuple[Callable, Union[ExecutionResult, Observable]]
135134
class Root(object):
136-
137135
class inbox(object):
138136
emails = [
139137
Email(

graphql/execution/tests/test_union_interface.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,18 @@
1919

2020

2121
class Dog(object):
22-
2322
def __init__(self, name, barks):
2423
self.name = name
2524
self.barks = barks
2625

2726

2827
class Cat(object):
29-
3028
def __init__(self, name, meows):
3129
self.name = name
3230
self.meows = meows
3331

3432

3533
class Person(object):
36-
3734
def __init__(self, name, pets, friends):
3835
# type: (str, List, List[Person]) -> None
3936
self.name = name

graphql/execution/tests/test_variables.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,6 @@ def test_does_not_allow_unknown_types_to_be_used_as_values():
753753

754754
# noinspection PyMethodMayBeStatic
755755
class TestUsesArgumentDefaultValues:
756-
757756
def test_when_no_argument_provided(self):
758757
# type: () -> None
759758
check(

0 commit comments

Comments
 (0)