Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass arguments to websockets.connect + some ssl tests + some cleaning #83

Merged
merged 60 commits into from
May 15, 2020
Merged

Conversation

leszekhanusz
Copy link
Collaborator

No description provided.

Necessitate Python 3.6

Allows a connection to an Apollo GraphQL websocket endpoint

Supports fetching schema from transport using the introspection query
Supports queries, mutations AND subscriptions
Supports connection using a client ssl certificate

Only one request per connection for now
It is now possible to execute multiple queries in parallel using the same websocket connection
Adding fixtures to create a websocket server for the tests
Allow ssl=False argument in transport
Adding exceptions:
- TransportProtocolError
- TransportQueryError
- TransportServerError
- TransportClosed

Now 100% code coverage for transport/websockets.py
Improvement of 'server' test fixture to simplify tests (list only answers)
Added _wait_closed event and wait_close coroutine to wait for the close
task to finish

Add exception 'TransportAlreadyConnected' used when trying to connect
to an already connected transport

Added new tests to test multiple connections in series or in parallel

Refactor:
- rename _close to _fail
- rename _answer_loop to _receive_data_loop
- rename listen_loop to receive_data_task
Testing validation using schema, type_def or introspection

Fixing some flake8/black styling issues in tests_py36
From this commit of pytest-asyncio:
pytest-dev/pytest-asyncio@a9e2213

The asyncio tests were not working anymore
This is a bug of pytest-asyncio:
pytest-dev/pytest-asyncio#157

As a workaround, adding event_loop parameter to all asyncio tests
…cify init payload

+ tests and documentation
+ black for style in tests_py36 folder
Adding tests to have 100% async client coverage without online tests
This allows us to keep the execute method sync in the AsyncClient class
Rename client to session in all tests

It is now possible to execute GraphQL queries synchronously on asynchronous transports

Returning ExecutionResult.data instead of ExecutionResult in AsyncClient
(This corresponds to the previous usage of the library)
leszekhanusz and others added 24 commits May 11, 2020 22:45
Removing pytest_aiohttp dependency (copy only the fixture we need)
Fixing import order with isort
Modify isort config to be compatible with black
Now isort will fail if invalid import order is found

isort upgraded to version 4.2.8 to fix bug
PyCQA/isort#537

Fix posargs in tox.ini to allow to run tox for specific tests
Add -s to pytest to have better logs in tox
Add -vb (verbose) to isort to have better logs in tox
For some reason on pypy3 with the version on travis (3.6.1),
it takes 10 seconds to leave the async generator...
So we increase the default timeout for a sync execute
Add execute_timeout to AsyncClient
Add connect_timeout, ack_timeout and close_timeout to websockets transport

Fix asyncio bugs of pypy3 v3.6.1 by adding await generator.aclose() in async for
Now flake8 also verify the tests_py36 folder
websockets: ssl argument is guessed from url if not provided
Adding websockets ssl test with self signed certificate
Using the self cert from websockets tests
@coveralls
Copy link

coveralls commented May 15, 2020

Coverage Status

Coverage increased (+0.005%) to 99.502% when pulling 84713b9 on leszekhanusz:master into 6525401 on graphql-python:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 99.502% when pulling c8d5518 on leszekhanusz:master into 3571d5f on graphql-python:master.

@Cito Cito merged commit b6d5e72 into graphql-python:master May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants