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

Update async tests to use builtin python suite #935

Merged
merged 4 commits into from
Aug 24, 2023

Conversation

DanielArndt
Copy link
Contributor

Description

As of Python 3.8, AsyncMock and many other async testing tools are available as standard libraries. This PR removes the third-party library asynctest and replaces it with those available in the standard python library.

As part of this, the tests will now run on Python 3.11, which they previously did not.

Additionally, warnings during tests are significantly reduced (from hundreds, to tens).

QA Steps

Running the unit and integration tests is hopefully sufficient

Notes & Discussion

I went down a rabbit hole here while investigating something totally unrelated. I understand if this change needs a more thorough review which there may or may not be time for, but I thought I'd put up the change since I was having some fun digging in.

As of Python 3.8, `AsyncMock` and many other async testing tools are
available as standard libraries. This PR removes the third-party library
`asynctest` and replaces it with those available in the standard python
library.

As part of this, the tests will now run on Python 3.11, which they
previously did not.

Additionally, warnings during tests are significantly reduced (from
hundreds, to tens).
@jujubot
Copy link
Contributor

jujubot commented Aug 23, 2023

Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch.

@hpidcock @anvial

1 similar comment
@jujubot
Copy link
Contributor

jujubot commented Aug 23, 2023

Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch.

@hpidcock @anvial

@cderici
Copy link
Contributor

cderici commented Aug 23, 2023

@DanielArndt thanks for the change! Let's get this in a working order and I'd be happy to give it a thorough review. For that, please fix the linter and let's see what's going on in the CI and I'll take it from there 👍

@DanielArndt

This comment was marked as outdated.

@cderici
Copy link
Contributor

cderici commented Aug 23, 2023

/build

@cderici
Copy link
Contributor

cderici commented Aug 23, 2023

/build

Copy link
Contributor

@cderici cderici left a comment

Choose a reason for hiding this comment

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

CI test failures are known intermittent errors unrelated to this change. They will be fixed soon in a subsequent PR.

Thanks again for the change! Good cleanup for sure 👍

@cderici
Copy link
Contributor

cderici commented Aug 24, 2023

/merge

@jujubot jujubot merged commit f21bc42 into juju:master Aug 24, 2023
4 of 5 checks passed
@DanielArndt DanielArndt deleted the update-async-tests branch August 24, 2023 11:40
@cderici cderici mentioned this pull request Sep 6, 2023
jujubot added a commit that referenced this pull request Sep 7, 2023
#945

## What's Changed

* Repository Maintenance Improvements by @cderici in #922
* Stale bot to not bother feature requests by @cderici in #926
* Fix linter issues by @cderici in #928
* Fix docstring typo by @DanielArndt in #927
* Fix asyncio on README by @marceloneppel in #930
* Fix integration/test_application.test_action by @cderici in #932
* Update 3.2 facade clients by @cderici in #931
* [JUJU-4488] Add licence headers to source files on 3.x by @cderici in #934
* Update async tests to use builtin python suite by @DanielArndt in #935
* Pass correct charm url to series selector by @cderici in #942
* Green CI cleanup for python-libjuju by @cderici in #939
* Bring forward support for nested assumes expressions on 3x by @cderici in #943

### Notes

JUJU-4532

[JUJU-4488]: https://warthogs.atlassian.net/browse/JUJU-4488?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@cderici cderici mentioned this pull request Oct 26, 2023
jujubot added a commit that referenced this pull request Oct 26, 2023
#980

## What's Changed
* Repository Maintenance Improvements by @cderici in #922
* Stale bot to not bother feature requests by @cderici in #926
* Fix linter issues by @cderici in #928
* Fix docstring typo by @DanielArndt in #927
* Fix asyncio on README by @marceloneppel in #930
* Fix integration/test_application.test_action by @cderici in #932
* Update 3.2 facade clients by @cderici in #931
* [JUJU-4488] Add licence headers to source files on 3.x by @cderici in #934
* Update async tests to use builtin python suite by @DanielArndt in #935
* Pass correct charm url to series selector by @cderici in #942
* Green CI cleanup for python-libjuju by @cderici in #939
* Bring forward support for nested assumes expressions on 3x by @cderici in #943
* Release 3.2.2.0 notes by @cderici in #945
* Cleanup release process for 3.x by @cderici in #946
* Use new DeployFromRepository endpoint for deploy by @cderici in #949
* Handle pending upload resources deployfromrepository by @cderici in #953
* Optimize connection teardown by @cderici in #952
* Use `log.warning` instead of the deprecated `warn` by @sed-i in #954
* Find controller name by endpoint on 3.x track by @cderici in #966
* Optimize & fix unit removal by @cderici in #967
* Allow switch kwarg in refresh to switch to local charms by @jack-w-shaw in #971
* Parse charm URLs consistantly for local charms by @jack-w-shaw in #974
* Juju config directory location fix on 3.x by @cderici in #976
* [JUJU-4779] Ensure valid charm origin for local charm switches by @jack-w-shaw in #978
* Application refresh with resources on 3.x by @cderici in #973

#### Notes & Discussion

JUJU-4851

[JUJU-4488]: https://warthogs.atlassian.net/browse/JUJU-4488?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-4779]: https://warthogs.atlassian.net/browse/JUJU-4779?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
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