Skip to content

Fix test_time_zoneinfo edge case#1411

Merged
caronc merged 2 commits intocaronc:masterfrom
LaFeev:fix_test_apprise_utils
Sep 30, 2025
Merged

Fix test_time_zoneinfo edge case#1411
caronc merged 2 commits intocaronc:masterfrom
LaFeev:fix_test_apprise_utils

Conversation

@LaFeev
Copy link
Contributor

@LaFeev LaFeev commented Sep 8, 2025

Description:

Related issue (if applicable): #1405

As discussed here, a reliance on the system-dependent IANA timezone database results in the test_apprise_utils test failing (for me at least, on Windows). I fixed the test to:

  • preserve the original test, which will operate on a tester's system that still has the obsolete "America/Cordoba" time zone
  • test a slightly different, possibly redundant, scenario if the tester's system lacks the obsolete entry

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use tox -e lint and even tox -e format to autofix what it can)
  • Test coverage added (use tox -e minimal)

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/LaFeev/apprise.git@

# Test out the changes with the following command:
tox -e qa

…te assertions to handle possible inclusion of obsolete IANA entries
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.65%. Comparing base (969c8db) to head (f0f9692).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1411   +/-   ##
=======================================
  Coverage   99.65%   99.65%           
=======================================
  Files         174      174           
  Lines       22519    22519           
  Branches     3582     3582           
=======================================
  Hits        22441    22441           
  Misses         70       70           
  Partials        8        8           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caronc
Copy link
Owner

caronc commented Sep 9, 2025

I didn't know this had so many edge cases; I wonder if we should just pick a timezone that is the same in all systems? The goal is just to show the handling of it; deal with the IANA timezone differences.

Besides that; great accommodation regardless!

Thoughts?

@LaFeev
Copy link
Contributor Author

LaFeev commented Sep 10, 2025

How did you arrive at Cordoba as a test case? Did that come from seeing it in two entries in your available timezones list?
I think the existing tests cover the functionality of your helper function, and capturing the nuances of the IANA is outside the scope of your repo. Knowing that some people's IANA list won't allow "America/Cordoba" as a TZ param, you could alter that test case to use a different zone (or the full America/Argentina/Cordoba). Ultimately I think (but am not certain) that any zone with two entries in the list is an artifact of deprecation, with America/Cordoba slated for removal at some point in the future (not worth inclusion in your tests IMO).
Not sure if that helps..

@caronc
Copy link
Owner

caronc commented Sep 11, 2025

How did you arrive at Cordoba as a test case?

Basically i just wanted to verify that my new timezone function correctly supported:

  • Country/Zone1
  • Country/Zone1/Zone2

The latter was just the first one I had found, but there are maybe better ones to choose that aren't being phased out and common across all distributions?

@caronc caronc merged commit 181103d into caronc:master Sep 30, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants