Issue 29693: DeprecationWarning/SyntaxError in test_import (original) (raw)
$ ./python -Wa -m test.regrtest test_import Run tests sequentially 0:00:00 [1/1] test_import /home/serhiy/py/cpython/Lib/test/test_import/init.py:88: DeprecationWarning: invalid escape sequence ( self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'os' (.*os.py)") /home/serhiy/py/cpython/Lib/test/test_import/init.py:96: DeprecationWarning: invalid escape sequence ( self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'select' (.*.(so|pyd))") 1 test OK.
Total duration: 2 sec Tests result: SUCCESS
$ ./python -We -m test.regrtest test_import Run tests sequentially 0:00:00 [1/1] test_import test test_import crashed -- Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/test/libregrtest/runtest.py", line 152, in runtest_inner the_module = importlib.import_module(abstest) File "/home/serhiy/py/cpython/Lib/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 978, in _gcd_import File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 675, in exec_module File "", line 782, in get_code File "", line 742, in source_to_code File "", line 205, in _call_with_frames_removed File "/home/serhiy/py/cpython/Lib/test/test_import/init.py", line 88 self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'os' (.*os.py)") ^ SyntaxError: invalid escape sequence (
test_import failed
1 test failed: test_import
Total duration: 244 ms Tests result: FAILURE