kennedyshead / aioasuswrt

MIT License
24 stars 24 forks source link

fixed the test_regex.py file to enable python 38 support #61

Closed JJdeVries closed 3 years ago

JJdeVries commented 3 years ago

I've made some changes to the test_regex.py to ensure that python 38 no longer fails in the tests.

The main problem seemed to be that iscoroutinefunction did not become True for an asyncio.Future. I'm not entirely sure why this only became problematic in python 3.8, a quick check didn't really find any specific changes there.

I've also changed the way the mocking was used in the method. Now the private imports are no longer necessary, and for me it's easier to understand now that the test function determines the expected return value of the async_run_command method. The downside is that especially for the methods using multiple calls to async_run_command the setting the return value is not ideal (as the order of specification matters a lot, meaning a change in the asuswrt.py file would also need changes here :-().

If merged this should fix #49, although I'm unsure if we want to enable testing automatically for python 3.8? I'm also not entirely sure how to do that, I guess simply by extending the list in .travis.yaml?

kennedyshead commented 3 years ago

Have added 3.10-dev as well now.

About travis, have no idea where its used actually?! Made no difference that I can see when I edited that?!

I guess it can be removed?

JJdeVries commented 3 years ago

At the very least it seems a bit overdone to both use github actions, and travis to do CI. So I agree with removing it.

For the actual release it might be good to see if we can fix #62 as well before pushing a new release.