microblog-api icon indicating copy to clipboard operation
microblog-api copied to clipboard

remove deprecated datetime.utcnow

Open yuxiaoy1 opened this issue 1 year ago • 2 comments

yuxiaoy1 avatar Jan 16 '24 15:01 yuxiaoy1

I'd like to format the whole codebase using Ruff, what do you think? @miguelgrinberg

yuxiaoy1 avatar Jan 17 '24 13:01 yuxiaoy1

@yuxiaoy1 No, thanks. I manage many projects and prefer to have a consistent management solution. When/if I decide to auto-format my code, I'll implement a general solution across all my projects.

miguelgrinberg avatar Jan 17 '24 14:01 miguelgrinberg

Hello @miguelgrinberg , can you help with the github CI errors, thank you.

yuxiaoy1 avatar Jun 07 '24 14:06 yuxiaoy1

The CI errors indicate you haven't given this problem enough thought. The change is not as simple as you may have initially thought. When I have time I'll look into this myself.

FAILED tests/test_auth.py::AuthTests::test_get_token - TypeError: can't compare offset-naive and offset-aware datetimes
FAILED tests/test_auth.py::AuthTests::test_oauth - TypeError: can't compare offset-naive and offset-aware datetimes
FAILED tests/test_auth.py::AuthTests::test_refresh_revoke_all - TypeError: can't compare offset-naive and offset-aware datetimes
FAILED tests/test_auth.py::AuthTests::test_refresh_token - TypeError: can't compare offset-naive and offset-aware datetimes
FAILED tests/test_auth.py::AuthTests::test_revoke - TypeError: can't compare offset-naive and offset-aware datetimes
FAILED tests/test_auth.py::AuthTests::test_token_expired - TypeError: '>' not supported between instances of 'datetime.datetime' and 'MagicMock'

miguelgrinberg avatar Jun 08 '24 10:06 miguelgrinberg

I have made this change myself now. Thanks.

miguelgrinberg avatar Jun 08 '24 14:06 miguelgrinberg