Kurt
Kurt

Reputation: 11

Python behave issue

I'm trying to use behave 1.2.5 with Python 2.6. Unfortunately I'm stuck with this version of Python for the moment.

When defining handlers with parameter, such as

@given('we have behave {x} installed') def step_impl(context, x): ...

I get the following error message

    File "build/bdist.solaris-2.11-sun4v/egg/behave/model.py", line 1903, in run
      self.func(context, *args, **kwargs)
  TypeError: step_impl() keywords must be strings

To me this is an indication that the step handler is being invoked with a dictionary where keys are unicode strings rather than regular strings.

If this is the case, does it have a solution?

Kurt

Upvotes: 1

Views: 426

Answers (1)

Cynic
Cynic

Reputation: 7216

You're supposed to include the double quotes around the brackets in your step definition. It should be:

@given('we have behave "{x}" installed')

Upvotes: 2

Related Questions