Skip to content

Commit 0a3cff2

Browse files
committed
addressing formatting issues reported by black.
1 parent 74b869a commit 0a3cff2

File tree

5 files changed

+18
-34
lines changed

5 files changed

+18
-34
lines changed

examples/comparison.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
class Stereo(ABC):
66
@abstractmethod
77
@contextmanager
8-
def play(self):
9-
...
8+
def play(self): ...
109

1110

1211
class StockStereo(ABC):
@@ -79,8 +78,7 @@ def with_high_end_stereo(self):
7978

8079
class Vehicle(ABC):
8180
@abstractmethod
82-
def drive_to_work(self):
83-
...
81+
def drive_to_work(self): ...
8482

8583

8684
class VehicleBuilder(BuilderBase[Vehicle]):

examples/duplicate_interfaces_example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
This gets very close to the service lookup pattern so it should be
55
avoided, However, the following is a decent workaround.
66
"""
7+
78
from abc import ABC, abstractmethod
89
from typing import Callable, TypeAlias
910

tests/autowire_pkg/interface.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44

55
class GreeterInterface(ABC):
66
@abstractmethod
7-
def greet(self, name: str = None) -> str:
8-
...
7+
def greet(self, name: str = None) -> str: ...
98

109
@abstractmethod
11-
def set_language(self, lang: str) -> None:
12-
...
10+
def set_language(self, lang: str) -> None: ...
1311

1412

1513
class FormatterInterface(ABC):
1614
@abstractmethod
17-
def format(self, name: str) -> str:
18-
...
15+
def format(self, name: str) -> str: ...
1916

2017

2118
FormatterFactory = Callable[[str], FormatterInterface]

tests/test_autowire.py

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ def setUp(self):
1111

1212
def test_binding_decorator_stages_binding_with_defaults(self):
1313
@bind()
14-
class MyClass:
15-
...
14+
class MyClass: ...
1615

1716
self.assertListEqual(
1817
AutoWireContainerBuilder._staged_bindings,
@@ -26,8 +25,7 @@ class MyClass:
2625

2726
def test_binding_decorator_sets_scope(self):
2827
@bind(scope="SINGLETON")
29-
class MyClass:
30-
...
28+
class MyClass: ...
3129

3230
self.assertListEqual(
3331
AutoWireContainerBuilder._staged_bindings,
@@ -40,12 +38,10 @@ class MyClass:
4038
)
4139

4240
def test_binding_decorator_sets_annotation(self):
43-
class MyClassInterface:
44-
...
41+
class MyClassInterface: ...
4542

4643
@bind(MyClassInterface)
47-
class MyClass:
48-
...
44+
class MyClass: ...
4945

5046
self.assertListEqual(
5147
AutoWireContainerBuilder._staged_bindings,
@@ -64,8 +60,7 @@ def my_activator(x):
6460
return x
6561

6662
@bind(on_activate=my_activator)
67-
class MyClass:
68-
...
63+
class MyClass: ...
6964

7065
self.assertListEqual(
7166
AutoWireContainerBuilder._staged_bindings,
@@ -82,8 +77,7 @@ class MyClass:
8277
def test_binding_factory_decorator_stages_binding_with_defaults(self):
8378
@bind_factory("MyFactory")
8479
def my_factory(ctx):
85-
def wrapped(foo):
86-
...
80+
def wrapped(foo): ...
8781

8882
return wrapped
8983

@@ -102,8 +96,7 @@ def test_binding_factory_requires_annotation(self):
10296

10397
@bind_factory()
10498
def my_factory(ctx):
105-
def wrapped(foo):
106-
...
99+
def wrapped(foo): ...
107100

108101
return wrapped
109102

@@ -156,23 +149,19 @@ def test_autowire_can_build_from_submodules(self):
156149

157150
def test_autowire_raises_on_duplicates(self):
158151
class QuackInterface:
159-
def quack(self) -> None:
160-
...
152+
def quack(self) -> None: ...
161153

162154
@bind(QuackInterface)
163155
class Squeak(QuackInterface):
164-
def quack(self) -> None:
165-
...
156+
def quack(self) -> None: ...
166157

167158
@bind(QuackInterface)
168159
class Honk(QuackInterface):
169-
def quack(self) -> None:
170-
...
160+
def quack(self) -> None: ...
171161

172162
@bind()
173163
class Duck:
174-
def __init__(self, quack: QuackInterface) -> None:
175-
...
164+
def __init__(self, quack: QuackInterface) -> None: ...
176165

177166
with self.assertRaises(AutoWireError):
178167
AutoWireContainerBuilder("tests.test_autowire").build()

tests/test_builder_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
GreeterFactory = Callable[[str], str]
99

1010

11-
class Foo:
12-
...
11+
class Foo: ...
1312

1413

1514
class FooBuilder(BuilderBase[Foo]):

0 commit comments

Comments
 (0)