Skip to content

Commit 8b59b25

Browse files
committed
Apply the code linter
1 parent 32ec021 commit 8b59b25

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

tests/test_syntax.py

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from __future__ import annotations
88

99
import pytest
10-
from typing import Protocol
1110

1211
import appose
1312
from appose import TaskException
@@ -183,7 +182,11 @@ def test_auto_proxy():
183182

184183
# Return a non-serializable object from a task - should auto-proxy
185184
# datetime is not JSON-serializable
186-
dt = service.task("import datetime\ndatetime.datetime(2024, 1, 15, 10, 30, 45)").wait_for().result()
185+
dt = (
186+
service.task("import datetime\ndatetime.datetime(2024, 1, 15, 10, 30, 45)")
187+
.wait_for()
188+
.result()
189+
)
187190

188191
# dt should be a proxy object now
189192
assert dt is not None
@@ -199,7 +202,8 @@ def test_auto_proxy():
199202

200203
# Access a field that returns a primitive type
201204
# Counter doesn't have simple fields, so let's create a custom class
202-
custom = service.task("""
205+
custom = (
206+
service.task("""
203207
class CustomClass:
204208
def __init__(self):
205209
self.value = 42
@@ -209,7 +213,10 @@ def get_double(self):
209213
return self.value * 2
210214
211215
CustomClass()
212-
""").wait_for().result()
216+
""")
217+
.wait_for()
218+
.result()
219+
)
213220

214221
# Access primitive fields
215222
assert custom.value == 42
@@ -219,7 +226,8 @@ def get_double(self):
219226
assert custom.get_double() == 84
220227

221228
# Test nested object access
222-
nested = service.task("""
229+
nested = (
230+
service.task("""
223231
class Inner:
224232
def __init__(self):
225233
self.data = "inner_data"
@@ -233,7 +241,10 @@ def __init__(self):
233241
self.label = "outer"
234242
235243
Outer()
236-
""").wait_for().result()
244+
""")
245+
.wait_for()
246+
.result()
247+
)
237248

238249
# Access nested object
239250
assert nested.label == "outer"
@@ -260,7 +271,8 @@ def test_callable_proxy():
260271
assert result == 42
261272

262273
# Create a custom callable class
263-
callable_obj = service.task("""
274+
callable_obj = (
275+
service.task("""
264276
class Adder:
265277
def __init__(self, offset):
266278
self.offset = offset
@@ -269,7 +281,10 @@ def __call__(self, x):
269281
return x + self.offset
270282
271283
Adder(100)
272-
""").wait_for().result()
284+
""")
285+
.wait_for()
286+
.result()
287+
)
273288

274289
# Call the callable object
275290
result = callable_obj(23)
@@ -286,7 +301,8 @@ def test_proxy_dir():
286301
maybe_debug(service)
287302

288303
# Create a custom class with known attributes
289-
obj = service.task("""
304+
obj = (
305+
service.task("""
290306
class TestClass:
291307
def __init__(self):
292308
self.field1 = 42
@@ -299,7 +315,10 @@ def method2(self, x):
299315
return x * 2
300316
301317
TestClass()
302-
""").wait_for().result()
318+
""")
319+
.wait_for()
320+
.result()
321+
)
303322

304323
# Get dir() output
305324
attrs = dir(obj)
@@ -318,7 +337,11 @@ def method2(self, x):
318337
assert "__class__" in attrs
319338

320339
# Test with a built-in object (datetime)
321-
dt = service.task("import datetime\ndatetime.datetime(2024, 1, 15)").wait_for().result()
340+
dt = (
341+
service.task("import datetime\ndatetime.datetime(2024, 1, 15)")
342+
.wait_for()
343+
.result()
344+
)
322345
dt_attrs = dir(dt)
323346

324347
assert isinstance(dt_attrs, list)

0 commit comments

Comments
 (0)