Applying black formatting

- Fixing flake8 configuration to agree with black
- Adding black validation check to github actions
This commit is contained in:
Jacob Alexander
2021-10-01 11:00:22 -07:00
parent 5dade41aeb
commit 6e7fffd7de
51 changed files with 2536 additions and 1837 deletions

View File

@@ -1,6 +1,6 @@
'''
"""
thread test
'''
"""
import platform
import socket
@@ -16,13 +16,13 @@ import test_capability_capnp
@pytest.mark.skipif(
platform.python_implementation() == 'PyPy',
reason="pycapnp's GIL handling isn't working properly at the moment for PyPy"
platform.python_implementation() == "PyPy",
reason="pycapnp's GIL handling isn't working properly at the moment for PyPy",
)
def test_making_event_loop():
'''
"""
Event loop test
'''
"""
capnp.remove_event_loop(True)
capnp.create_event_loop()
@@ -31,13 +31,13 @@ def test_making_event_loop():
@pytest.mark.skipif(
platform.python_implementation() == 'PyPy',
reason="pycapnp's GIL handling isn't working properly at the moment for PyPy"
platform.python_implementation() == "PyPy",
reason="pycapnp's GIL handling isn't working properly at the moment for PyPy",
)
def test_making_threaded_event_loop():
'''
"""
Threaded event loop test
'''
"""
# The following raises a KjException, and if not caught causes an SIGABRT:
# kj/async.c++:973: failed: expected head == nullptr; EventLoop destroyed with events still in the queue.
# Memory leak?; head->trace() = kj::_::ForkHub<kj::_::Void>
@@ -54,27 +54,28 @@ def test_making_threaded_event_loop():
class Server(test_capability_capnp.TestInterface.Server):
'''
"""
Server
'''
"""
def __init__(self, val=100):
self.val = val
def foo(self, i, j, **kwargs):
'''
"""
foo
'''
"""
return str(i * 5 + self.val)
@pytest.mark.skipif(
platform.python_implementation() == 'PyPy',
reason="pycapnp's GIL handling isn't working properly at the moment for PyPy"
platform.python_implementation() == "PyPy",
reason="pycapnp's GIL handling isn't working properly at the moment for PyPy",
)
def test_using_threads():
'''
"""
Thread test
'''
"""
capnp.remove_event_loop(True)
capnp.create_event_loop(True)
@@ -94,4 +95,4 @@ def test_using_threads():
remote = cap.foo(i=5)
response = remote.wait()
assert response.x == '125'
assert response.x == "125"