Skip to content

Commit

Permalink
py3.10 testfix
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Aug 20, 2023
1 parent 1b1d116 commit b365ec3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_locale.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def test_detect_language_windows_users():

if hasattr(ctypes, 'windll'):
from ctypes import windll

else:
windll = mock.Mock()
# 4105 = en_CA
Expand All @@ -166,8 +167,7 @@ def test_detect_language_windows_users():

def test_detect_language_using_env():
"""
When enabling CI testing on Windows, those tests did not produce the
correct results. They may want to be reviewed.
Test the reading of information from an environment variable
"""

# The below accesses the windows fallback code and fail
Expand All @@ -194,7 +194,6 @@ def test_detect_language_using_env():
assert isinstance(AppriseLocale.AppriseLocale.detect_language(), str)


@pytest.mark.skipif(sys.platform == "win32", reason="Does not work on Windows")
@mock.patch('locale.getlocale')
def test_detect_language_locale(mock_getlocale):
"""
Expand All @@ -203,7 +202,8 @@ def test_detect_language_locale(mock_getlocale):
"""
# Handle case where getlocale() can't be detected
mock_getlocale.return_value = None
assert AppriseLocale.AppriseLocale.detect_language() is None
with environ('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG'):
assert AppriseLocale.AppriseLocale.detect_language() is None

# if detect_language and windows env fail us, then we don't
# set up a default language on first load
Expand Down

0 comments on commit b365ec3

Please sign in to comment.