Skip to content

Commit 2a1c451

Browse files
authored
Remove usage of re.compile in example code
1 parent 956081c commit 2a1c451

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -974,13 +974,13 @@ Using unicode in the feature files
974974
----------------------------------
975975

976976
As mentioned above, by default, utf-8 encoding is used for parsing feature files.
977-
For steps definition, you can both use unicode- and bytestrings equally.
978-
However, for argumented steps, if you need to use unicode symbols in it's regular expression, use `u` sign with regex:
977+
For steps definition, you should use unicode strings, which is the default in python 3.
978+
If you are on python 2, make sure you use unicode strings by prefixing them with the `u` sign.
979979

980980

981981
.. code-block:: python
982982
983-
@given(re.compile(u"у мене є рядок який містить '{0}'".format('(?P<content>.+)')))
983+
@given(parsers.re(u"у мене є рядок який містить '{0}'".format(u'(?P<content>.+)')))
984984
def there_is_a_string_with_content(content, string):
985985
"""Create string with unicode content."""
986986
string['content'] = content

0 commit comments

Comments
 (0)