zerex290 / sankaku

Asynchronous API wrapper for Sankaku Complex with type-hinting, pydantic data validation and an optional logging support with loguru.
https://zerex290.github.io/sankaku/
MIT License
8 stars 3 forks source link

GitHub workflow for unittesting is not working correctly #6

Open zerex290 opened 1 year ago

zerex290 commented 1 year ago

At the moment asynchronous unittests in workflow are always passed, even if they shouldn't (because of possible bugs). The reason of pass of all asynchronous tests is skipping tests by pystest with such warnings. These warnings means that pytest doesn't try to await created coroutine test objects.

Using plugins (suggested by pytest) at requirements-test.txt (trio, twisted etc) doesn't really await async functions because of default asyncio_mode=STRICT configuration which involves decorating asynchronous test functions with @pytest.mark.asyncio.

Such unwanted behaviour can be fixed by using pytest-asyncio plugin for pytest and setting asyncio_mode=auto at pytest.ini file.

These steps can allow to perform testing correctly (and it has been successfully checked locally), but new problem occurs at github actions workflow: Tests requiring authorization fail with SankakuServerError and status code 500. And the oddity is that not all mentioned test fail.