Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python u-string patterns #173

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Conversation

kieran-ryan
Copy link
Sponsor Member

@kieran-ryan kieran-ryan commented Jan 3, 2024

🤔 What's changed?

Introduced support for u-strings (explicit unicode strings e.g. u"") for Python step definitions.

⚡️ What's your motivation?

Resolves cucumber/vscode#173, allowing step definition patterns written with Python u-strings.

@given(u"I have 58 cukes in my belly")
def step_impl(context):
    ...

Although not required in Python 3, they are usable and are suggested in missing step definitions for Behave due to Python 2 compatibility.

Developer experience has been improved for Python unit tests by changing asserts to assert.strictEqual, which shows exact match failures in strings - so that they can be fixed - compared to simply stating condition was not True.

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

@kieran-ryan kieran-ryan self-assigned this Jan 3, 2024
@kieran-ryan kieran-ryan changed the title Support Python u-strings Python u-string patterns Jan 7, 2024
@kieran-ryan kieran-ryan added the ⚡ enhancement Request for new functionality label Jan 7, 2024
@kieran-ryan kieran-ryan merged commit 273f9e8 into cucumber:main Jan 17, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python ⚡ enhancement Request for new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explicit unicode strings in Python step definition patterns
1 participant