powerline/tests/test_python
Carl Smedstad 8484023b7b
Fix Python deprecations (#2262)
* Add missing import 'types'

The commit 6950c04614d0bd1fc9c61b79ec7e2be0d16abdc4 did the following,
but missed to import the 'types' module:

-    module = imp.new_module(name)
+    module = types.ModuleType(name)

* Remove usage of 'imp' module - removed in Python 3.12

* Remove usage of deprecated method locale.getdefaultlocale()

Fixes the following deprecation warning:

powerline/lib/encoding.py:49: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
  or locale.getdefaultlocale()[1]

* Fix invalid escape sequences

Specifically:

    powerline/bindings/config.py:179: SyntaxWarning: invalid escape sequence '\$'
    powerline/lint/__init__.py:208: SyntaxWarning: invalid escape sequence '\w'
    powerline/lint/__init__.py:226: SyntaxWarning: invalid escape sequence '\w'
    powerline/lint/__init__.py:44: SyntaxWarning: invalid escape sequence '\w'
    powerline/lint/spec.py:24: SyntaxWarning: invalid escape sequence '\w'
    powerline/lint/spec.py:588: SyntaxWarning: invalid escape sequence '\w'
    powerline/segments/common/mail.py:36: SyntaxWarning: invalid escape sequence '\d'
2024-08-29 20:00:48 +09:00
..
empty Move tests run by run_python_tests to tests/test_python 2017-04-30 18:20:30 +03:00
test.sh Only enable tracing for “final” suites: suites not having subsuites 2018-02-25 22:16:05 +03:00
test_cmdline.py Export pipe status in bash bindings 2017-05-16 19:34:26 +03:00
test_config_merging.py Move tests run by run_python_tests to tests/test_python 2017-04-30 18:20:30 +03:00
test_config_reload.py Move tests run by run_python_tests to tests/test_python 2017-04-30 18:20:30 +03:00
test_configuration.py Move tests run by run_python_tests to tests/test_python 2017-04-30 18:20:30 +03:00
test_lib.py doc: installation, fix typo (#2041) 2019-11-03 04:29:20 +09:00
test_lib_config.py Move tests run by run_python_tests to tests/test_python 2017-04-30 18:20:30 +03:00
test_listers.py Use updated i3ipc syntax in i3 segments/listers (#2062) 2021-01-08 19:25:53 +09:00
test_logging.py Move tests run by run_python_tests to tests/test_python 2017-04-30 18:20:30 +03:00
test_provided_config_files.py Fix Python deprecations (#2262) 2024-08-29 20:00:48 +09:00
test_segments.py fix #2257 2024-05-12 04:45:27 +09:00
test_selectors.py Move tests run by run_python_tests to tests/test_python 2017-04-30 18:20:30 +03:00
test_watcher.py Move tests run by run_python_tests to tests/test_python 2017-04-30 18:20:30 +03:00