charmed-kubernetes / pytest-operator

Apache License 2.0
6 stars 13 forks source link

Use one model per test class #5

Closed johnsca closed 3 years ago

johnsca commented 3 years ago

This refactors how the async tests are run to allow for all the tests in a given class to share the same model. Neither the newer unittest nor the older asynctest supported this, so I had to resort to managing the event loop in the class-scoped fixture and wrapping the async test methods in a sync wrapper which used run_until_complete to execute the async test methods.