yunstanford / pytest-sanic

a Pytest Plugin for Sanic.
http://pytest-sanic.readthedocs.io/en/latest
Apache License 2.0
135 stars 20 forks source link

Sanic Unit Testing Error: AttributeError: __aenter__ #65

Closed Vedant-R closed 2 years ago

Vedant-R commented 2 years ago

Hi guys,

Thank you in advance.

Getting following error:

test_endpoint.py [2021-12-31 18:46:12 +0000] [33939] [INFO] Goin' Fast @ http://127.0.0.1:62918
[2021-12-31 18:46:12 +0000] [33939] [INFO] Goin' Fast @ http://127.0.0.1:62919
[2021-12-31 18:46:12 +0000] [33939] [ERROR] Exception occurred while handling uri: 'http://127.0.0.1:62919/predict'
Traceback (most recent call last):
  File "/Users/vedantruparelia/workspace/tensorflow-test/env/lib/python3.9/site-packages/sanic/app.py", line 770, in handle_request
    response = await response
  File "/Users/vedantruparelia/workspace/python_projects/tf_sanic_example/request_batching_server.py", line 106, in predict
    output = await style_transfer_runner.process_input(data)
  File "/Users/vedantruparelia/workspace/python_projects/tf_sanic_example/request_batching_server.py", line 48, in process_input
    async with self.queue_lock:
AttributeError: __aenter__
[2021-12-31 18:46:12 +0000] - (sanic.access)[INFO][127.0.0.1:62920]: POST http://127.0.0.1:62919/predict  500 735
<Response [500 Internal Server Error]>
Vedant-R commented 2 years ago

Got this sorted, thank you.

Closing it.

teinhonglo commented 1 year ago

Hi,

Could you share how you solved this problem? Many thanks.

TH