diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2022-06-03 15:23:14 -0400 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2022-06-03 15:23:14 -0400 |
commit | c42be15d86e919cebfe4a585d1db97fcaafdbe59 (patch) | |
tree | bfc45c3f2f59af6158667689f7e9399aac19f64e /tests/__init__.py | |
parent | 43c88d6e283aae649c5b706832e0e2610532066d (diff) | |
parent | 7c54625f8fc21d8381ecb4a1af74f2db5da96da1 (diff) |
Merge branch '2.8' into 2.9
Diffstat (limited to 'tests/__init__.py')
-rw-r--r-- | tests/__init__.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 9850f3c1..f43975d2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -36,7 +36,7 @@ def requireNonAsciiLocale(category_name="LC_ALL"): def _decorate_with_locale(category, try_locales, test_method): """Decorate test_method to run after switching to a different locale.""" - def _test_under_locale(testself, sftp): + def _test_under_locale(testself, *args, **kwargs): original = locale.setlocale(category) while try_locales: try: @@ -46,12 +46,11 @@ def _decorate_with_locale(category, try_locales, test_method): try_locales.pop(0) else: try: - return test_method(testself) + return test_method(testself, *args, **kwargs) finally: locale.setlocale(category, original) - skipTest = getattr(testself, "skipTest", None) - if skipTest is not None: - skipTest("No usable locales installed") + # No locales could be used? Just skip the decorated test :( + skip("No usable locales installed") functools.update_wrapper(_test_under_locale, test_method) return _test_under_locale |