Skip to content

Conversation

@DaleSeo
Copy link
Contributor

@DaleSeo DaleSeo commented Mar 6, 2020

What kind of change does this PR introduce?

I recently learned that it's been much easier to write unit tests against asynchronous code in Python 3.8.

This PR rewrites the tests for the execute_async method using IsolatedAsyncioTestCase and AsyncMock of the standard unittest module. This also results in the asynctest dependency removed from the project.

What is the current behavior?

No changes in behavior

What is the new behavior?

No changes in behavior

Does this PR introduce a breaking change?

No

Other information

@DaleSeo DaleSeo added the enhancement New feature or request label Mar 6, 2020
@DaleSeo DaleSeo self-assigned this Mar 6, 2020
@DaleSeo
Copy link
Contributor Author

DaleSeo commented Mar 6, 2020

@steve148 Do you have any idea why the linter fails on Github Actions when it passes locally? 🤷‍♂
image

@steve148
Copy link
Contributor

@DaleSeo sorry for the late reply here. The CI checks failing is my fault, the pre-commit check should include the flake8-isort as a dependency of the flake8 check. I'm creating a fix for that in a sec, to fix it in your case you can install flake8-isort locally and you should get the flake8 error listed in the github action CI check.

pip install flake8-isort
flake8

@steve148
Copy link
Contributor

Side note, for the next PR can you make sure it's coming from a fork of the repository? Right now you have write access to the repo and therefore you can create branches directly within the repo, but if we're expecting other people in the long run to fork for contributing we should also follow that standard. Let me know if you need any help for getting the fork setup for the next PR.

@steve148
Copy link
Contributor

#22 should fix the issue you're seeing here where local linter checks don't match the remote checks.

@DaleSeo
Copy link
Contributor Author

DaleSeo commented Mar 10, 2020

Side note, for the next PR can you make sure it's coming from a fork of the repository? Right now you have write access to the repo and therefore you can create branches directly within the repo, but if we're expecting other people in the long run to fork for contributing we should also follow that standard. Let me know if you need any help for getting the fork setup for the next PR.

👍 Got it! I'll work on a fork for the future PRs.

@DaleSeo
Copy link
Contributor Author

DaleSeo commented Mar 10, 2020

I'll rebase it onto master once PR #22 gets merged.

Copy link
Contributor

@steve148 steve148 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff @DaleSeo! Once you've rebased we can merge the changes in.

@DaleSeo
Copy link
Contributor Author

DaleSeo commented Mar 15, 2020

@steve148 I've rebased and sorted the imports in test_graphql_client.py using the isort CLI but the linter kept complaining as seen below.
image

I didn't know what to do so I just tried to commit with the --no-verify option to see if these changes happen to pass the linter on Github Actions and they passed. 🤷‍♂ It seems like there are still discrepancies between the pre-commit hook and the Github Actions workflow somehow. 🙁

@DaleSeo DaleSeo merged commit bb8e7b0 into master Mar 29, 2020
@DaleSeo DaleSeo deleted the async-test branch March 29, 2020 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants