Relax a test regex to match new enum repr in Python 3.10.0a7+ (#186)

bpo-40066: Enum: adjust repr() to show only enum and member name (not value,
nor angle brackets) and str() to show only member name.
https://bugs.python.org/issue40066
This commit is contained in:
Miro Hrončok
2021-04-22 21:04:49 +02:00
committed by GitHub
parent 966d5446eb
commit cbb61fb819

View File

@@ -339,7 +339,7 @@ def test_left_recursion():
@pytest.mark.parametrize( @pytest.mark.parametrize(
'grammar, error_match', [ 'grammar, error_match', [
['foo: bar | baz\nbar: NAME\nbaz: NAME\n', ['foo: bar | baz\nbar: NAME\nbaz: NAME\n',
r"foo is ambiguous.*given a PythonTokenTypes\.NAME.*bar or baz"], r"foo is ambiguous.*given a (PythonTokenTypes\.)?NAME.*bar or baz"],
['''foo: bar | baz\nbar: 'x'\nbaz: "x"\n''', ['''foo: bar | baz\nbar: 'x'\nbaz: "x"\n''',
r"foo is ambiguous.*given a ReservedString\(x\).*bar or baz"], r"foo is ambiguous.*given a ReservedString\(x\).*bar or baz"],
['''foo: bar | 'x'\nbar: 'x'\n''', ['''foo: bar | 'x'\nbar: 'x'\n''',