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

execute_step complains that steps must be unicode #126

Closed
floer32 opened this issue Feb 27, 2013 · 2 comments
Closed

execute_step complains that steps must be unicode #126

floer32 opened this issue Feb 27, 2013 · 2 comments
Milestone

Comments

@floer32
Copy link

floer32 commented Feb 27, 2013

When I try to run the following step:

@given(u'I log in as a superuser')
def step_log_in_as_a_superuser(context):
    context.execute_steps("""
        given the following superusers exist
            | email         | password      |
            | admin@foo.bar | pass          |
        when I submit the following data
            | name          | value         |
            | username      | admin@foo.bar |
            | password      | pass          |
        then I see the word "Welcome"
    """)

I get the following error:

Assertion Failed: Steps must be unicode.

Making the argument to execute_step a unicode string does the trick (context.execute_steps(u"""foo""")).

The docs don't make this clear in the example provided.

@jenisys
Copy link
Member

jenisys commented Feb 27, 2013

I agree that this is missing in the docs. It will be addressed with Python3 support.

SEE ALSO (example that shows this detail in Python2):
http://jenisys.github.com/behave.example/tutorials/tutorial08.html

The documentation is generated by running behave (and checking process result codes).
Therefore, I know these documented examples really work ;-)

@floer32
Copy link
Author

floer32 commented Feb 28, 2013

Great.

This tutorial looks great, this should be linked in - or part of - the official docs!

@jenisys jenisys closed this as completed Mar 10, 2013
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

No branches or pull requests

2 participants