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

Extend step decorator #94

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Extend step decorator #94

wants to merge 2 commits into from

Conversation

jricardo27
Copy link

Defines commonly used regexes for strings and numbers.
When using the string placeholder, the decorator creates two different steps to catch single and double quoted strings.

It also allows to register more placeholders to be replaced.

Defines commonly used regexes and allows to easily register two
different steps to capture single or double quoted strings.
It also allows to register more placeholders to be replaced.
def step(): # pylint:disable=missing-docstring
pass

steps = STEP_REGISTRY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not the same way as all the other tests?

@koterpillar
Copy link
Member

def __init__(self):
self.single_expression_placeholders = {
'NUMBER': r'(-?\d+(?:\.\d*)?)',
'NON_CAPTURING_STRING': r'|'.join((r'"[^"]*"', r"'[^']*'")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these two for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants