mauricekoster / gherkin2robotframework

Generate robotframework scripts from gherkins (and step definition file)
MIT License
9 stars 4 forks source link

Import Error when I launch #14

Open brice opened 1 week ago

brice commented 1 week ago

Hello,

I'm currently trying to use this program in one of my project :

When I execute the command : gherkin2robotframework 01_BDD_Robot/01_login.feature

I got this message.

Traceback (most recent call last):
  File "/home/brice/.local/bin/gherkin2robotframework", line 5, in <module>
    from gherkin2robotframework.__main__ import main
  File "/home/brice/.local/lib/python3.9/site-packages/gherkin2robotframework/__main__.py", line 27, in <module>
    from translation import get_language, tr, set_language
ImportError: cannot import name 'get_language' from 'translation' (/home/brice/.local/lib/python3.9/site-packages/translation/__init__.py)

So I checked sources and see that translation is in the program so I changed line number 27 in main.py with this

from gherkin2robotframework.translation import get_language, tr, set_language

And it works better.

What i'm missing here?

fabioluissilva commented 23 hours ago

You're right. And I don't understand also...

I had also to change line 156 to place a raw string, changing

kw = re.sub('\$\{[0-9a-zA-Z_]+\}', '(.*)', keyword)

to

kw = re.sub(r'\$\{[0-9a-zA-Z_]+\}', '(.*)', keyword)