__________________________________________ ERROR collecting tests/test_analysis.py ___________________________________________
.tox/py39/lib/python3.9/site-packages/_pytest/python.py:617: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
.tox/py39/lib/python3.9/site-packages/_pytest/pathlib.py:565: in import_path
importlib.import_module(module_name)
/usr/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
.tox/py39/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:169: in exec_module
source_stat, co = _rewrite_test(fn, self.config)
.tox/py39/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:351: in _rewrite_test
tree = ast.parse(source, filename=strfn)
/usr/lib/python3.9/ast.py:50: in parse
return compile(source, filename, mode, flags,
E File "/home/jamison/code/third-party/whoosh/tests/test_analysis.py", line 523
E t = analysis.RegexTokenizer("\w+")
E ^
E SyntaxError: invalid escape sequence \w
If you use this library with PYTHONWARNINGS=error::DeprecationWarning, you are met with the following error,
This change was purely mechanical; I ran
ruff check --fix --select W605
on the repository, https://beta.ruff.rs/docs/rules/#warning-w.You can also repro the errors with the following diff
which yields,