0

I have a simple feature where I am passing in 2 examples.

Background: I create context params calls
Given I create context params calls
And I populate default array1
And I populate default array2

Scenario Outline: I enter x array <a> and <b> and <c> and <d> and <e> and <f>and <g> and <h> and <i> and <j> and <k> and <l>
Given I have a a array <a>
And I have a b array <b>
And I have a c array <c>
And I have a d array <d>
And I have a e array <e>
When I call the interface
Then I will see <f> <g> <h> <i> <j> <k> <l>

When I run the test it might work first time I type behave into the command line or it might work the third time I type the behave command into the command line or the seventh time. At first I assumed this was my local set up so I transferred to another computer and installed behave and the same problem happened. I assume this is an error with my steps files but the only error I get is:

Exception OSError: raw write() returned invalid length 1508 (should have been between 0 and 754)
Traceback (most recent call last):
File "\lib\runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "\Scripts\behave.exe\__main__.py", line 9, in <module>
File "\lib\site-packages\behave\__main__.py", line 183, in main
return run_behave(config)
File "\lib\site-packages\behave\__main__.py", line 127, in run_behave
failed = runner.run()
File "\lib\site-packages\behave\runner.py", line 804, in run
return self.run_with_paths()
File "\lib\site-packages\behave\runner.py", line 824, in run_with_paths
return self.run_model()
File "\lib\site-packages\behave\runner.py", line 626, in run_model
failed = feature.run(self)
File "\lib\site-packages\behave\model.py", line 321, in run
failed = scenario.run(runner)
File "\lib\site-packages\behave\model.py", line 1114, in run
failed = scenario.run(runner)
File "c\lib\site-packages\behave\model.py", line 711, in run
if not step.run(runner):
File "\lib\site-packages\behave\model.py", line 1311, in run
formatter.match(match)
File "\lib\site-packages\behave\formatter\pretty.py", line 130, in match
self.print_statement()
File "lib\site-packages\behave\formatter\pretty.py", line 265, in  print_statement
self.stream.write("\n")
OSError: raw write() returned invalid length 1508 (should have been between 0 and 754)

Currently I assume it is something to do with my steps.py not initialising correctly but why would it work after multiple inputs of the behave command? And does any one know how to resolve this issue?

1 Answers1

0

I found https://github.com/Microsoft/vscode/issues/39149 as I was using pycharm terminal I believe I was suffering from this problem. When I switched to native terminal it runs every time.