Skip to content

Make datetime calls timezone-aware in tests #153

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

Merged
merged 2 commits into from
May 28, 2025

Conversation

mreid-tt
Copy link
Contributor

@mreid-tt mreid-tt commented May 25, 2025

Description

  • Replace utcnow().replace(microsecond=0) with now(timezone.utc).replace(microsecond=0, tzinfo=None) in test_api.py and test_nas.py
  • Ensures tests still use a UTC “now” but remain offset-naive, avoiding naive/aware subtraction errors and silencing the deprecation warning
  • No changes to existing 10-second delta assertions or other test logic

@mreid-tt mreid-tt self-assigned this May 25, 2025
@mreid-tt mreid-tt added enhancement python Pull requests that update python code and removed enhancement labels May 25, 2025
@mreid-tt mreid-tt merged commit bd7811a into SynoCommunity:main May 28, 2025
2 checks passed
@mreid-tt mreid-tt deleted the fix-deprecation-warnings branch May 28, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant