Skip to content

Commit cc676b7

Browse files
committed
Code formatting
1 parent c4fc243 commit cc676b7

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

src/labthings/core/lock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __call__(self, timeout=sentinel, blocking=True):
3838
yield result
3939
if result:
4040
self.release()
41-
41+
4242
def locked(self):
4343
return self._lock.locked()
4444

@@ -96,7 +96,7 @@ def __call__(self, timeout=sentinel, blocking=True):
9696
yield result
9797
if result:
9898
self.release()
99-
99+
100100
def acquire(self, blocking=True, timeout=sentinel):
101101
if timeout is sentinel:
102102
timeout = self.timeout

src/labthings/server/default_views/sockets.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
import logging
66

77

8-
STATIC_SOCKET_RESPONSES = {
9-
"__unittest": "__unittest_response"
10-
}
8+
STATIC_SOCKET_RESPONSES = {"__unittest": "__unittest_response"}
9+
1110

1211
def socket_handler(ws):
1312
# Create a socket subscriber

src/labthings/server/view/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ def dispatch_request(self, *args, **kwargs):
9999
meth = use_args(self.get_args())(meth)
100100

101101
# Marhal response if a response schema is defined
102-
if (
103-
request.method in self.marshal_methods
104-
and self.get_schema()
105-
):
102+
if request.method in self.marshal_methods and self.get_schema():
106103
meth = marshal_with(self.get_schema())(meth)
107104

108105
# Flask should ensure this is assersion never fails

src/labthings/server/view/args.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def wrapper(*args, **kwargs):
4545

4646
return wrapper
4747

48+
4849
class use_args:
4950
"""Equivalent to webargs.flask_parser.use_args"""
5051

tests/test_server_default_views_socket_handler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
def test_socket_handler(thing_ctx, fake_websocket):
88
with thing_ctx.test_request_context():
9-
ws = fake_websocket("__unittest", recieve_once=True, close_after=["__unittest_response"])
9+
ws = fake_websocket(
10+
"__unittest", recieve_once=True, close_after=["__unittest_response"]
11+
)
1012
socket_handler(ws)
1113
assert "__unittest_response" in ws.responses
1214

tests/test_server_spec_apispec.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,3 @@ def post(self):
180180
},
181181
},
182182
}
183-

tests/test_server_view.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def post(self):
147147
# Main test
148148
Index().get_value()
149149

150+
150151
def test_get_responses(app_ctx):
151152
class Index(view.View):
152153
def post(self):

0 commit comments

Comments
 (0)