Does Behave (BDD) work with Python 3.4?

I am using Behave (BDD for Python) and am trying to include JUnit output with no success. After troubleshooting, I realized that when using Python 3.4 I get the following message:

/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 "/Users/myusername/Documents/Programming/Selenium Programming/GMail Project/GMailTests.py"
Traceback (most recent call last):
  File "/Users/myusername/Documents/Programming/Selenium Programming/GMail Project/GMailTests.py", line 62, in <module>
    config = Configuration()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/behave/configuration.py", line 481, in __init__
    load_configuration(self.defaults, verbose=verbose)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/behave/configuration.py", line 394, in load_configuration
    defaults.update(read_configuration(filename))
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/behave/configuration.py", line 348, in read_configuration
    result[dest] = cfg.get('behave', dest, use_raw_value)
TypeError: get() takes 3 positional arguments but 4 were given

      

When I update my project to use Python 2.7 everything works fine.

Here's an important note: this only causes problems when I include the JUnit output in the config file behave.ini

. If I take the two lines below the config everything works fine. Unfortunately I need to enable JUnit output for my project:

[behave]
junit=true
junit_directory=./JunitReports

      

If you know any way I could make this work with Python 3.4, I would like to know about it. Thanks in advance.

+3


source to share


3 answers


Looks like I answered my own question in my last comment. I just wanted to close the thread and give an official answer on 8/13/2014: behave

not fully supported on , and even though most of them work fine when installed with , the output option doesn't work.Python

3.4

pip3 install behave

JUnit



There is a known issue that has been documented here .

0


source


Changing the first line in script: /usr/local/bin/behave

to: #!/usr/local/bin/python3

# you may need to run python3



solved the problem

+1


source


Use behave-1.2.5. Many Python3 / Unicode related issues have been fixed in this release. Testing is done on a server running Python 3.4 .

0


source







All Articles