You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried replacing "import re" with "import regex as re" in lex.py and yacc.py for good measure (I saw that regex is slotted for python 3.4 and that that module supports concurrency) but got two errors in the lex unit tests (python testlex.py):
FAIL: test_lex_re1 (main.LexErrorWarningTests)
Traceback (most recent call last):
File "testlex.py", line 143, in test_lex_re1
"Invalid regular expression for rule 't_NUMBER'. unbalanced parenthesis\n"))
AssertionError: False is not true
FAIL: test_lex_re3 (main.LexErrorWarningTests)
Traceback (most recent call last):
File "testlex.py", line 155, in test_lex_re3
"Invalid regular expression for rule 't_POUND'. unbalanced parenthesis\n"
AssertionError: False is not true
According to the maintainer of regex this is because the exception messages are different - regex throws "missing )" instead of "unbalanced parenthesis".
Is it correct to rely on the message strings for the unit tests?
The text was updated successfully, but these errors were encountered:
As far as I know, the status of "regex" in the standard library is pretty unclear at this point. Going to close the issue for now, but will revisit should its status change.
I tried replacing "import re" with "import regex as re" in lex.py and yacc.py for good measure (I saw that regex is slotted for python 3.4 and that that module supports concurrency) but got two errors in the lex unit tests (python testlex.py):
FAIL: test_lex_re1 (main.LexErrorWarningTests)
Traceback (most recent call last):
File "testlex.py", line 143, in test_lex_re1
"Invalid regular expression for rule 't_NUMBER'. unbalanced parenthesis\n"))
AssertionError: False is not true
FAIL: test_lex_re3 (main.LexErrorWarningTests)
Traceback (most recent call last):
File "testlex.py", line 155, in test_lex_re3
"Invalid regular expression for rule 't_POUND'. unbalanced parenthesis\n"
AssertionError: False is not true
According to the maintainer of regex this is because the exception messages are different - regex throws "missing )" instead of "unbalanced parenthesis".
Is it correct to rely on the message strings for the unit tests?
The text was updated successfully, but these errors were encountered: