SyntaxError: invalid escape sequence '\w'
Hello! I'm getting the following error
from pytestarch.diagram_extension.diagram_parser import PumlParser
E File "/usr/local/lib/python3.11/site-packages/pytestarch/diagram_extension/diagram_parser.py", line 28
E ANY_ARROW_TEXT = "(-?|\w+-)" # noqa: W605
E ^^^^^^^^^^^
E SyntaxError: invalid escape sequence '\w'
I use
- Python: 3.11.9
- pytestarch: 3.0.0
As I understand noqa: W605 disabled warning about that situation but now Python reports it as a syntax error.
Why not use that regex str like this "(-?|\\w+-)" or like this r"(-?|\w+-)"?
BTW I've changed (locally on my machine) regex strings to use r"..." notation and everything started to work well. So I probably can make a patch for this.
Hi! Thanks for bringing this to my attention! I don't quite recall why I opted to suppress the warning, but this clearly needs to be fixed. If you want to provide the patch, I would be very happy to merge it. :) Otherwise, I'm going to fix it over the weekend.
I've released the fix as version 3.0.1. Let me know if you're still experiencing issues - if not, I would close the ticket :) Thank you very much for contributing the fix!