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

WindowsError: [Error 2] The system cannot find the file specified #6

Open
ramiabughazaleh opened this issue May 26, 2015 · 1 comment

Comments

@ramiabughazaleh
Copy link

liveandletdie-0.0.5
Windows 7 x64 SP1
Behave BDD Framework 1.2.5

When I run behave on my features file, I get the following error:

C:\liveandletdie\features>behave tests.feature
Feature: REST web service API # tests.feature:1
  Is pingable
  Scenario: A ping request responds successfully  # tests.feature:4
    Given The web server is running               # steps\tests.py:12
      Traceback (most recent call last):
        File "C:\Python27\lib\site-packageehave\model.py", line 1456, in run
          match.run(runner.context)
        File "C:\Python27\lib\site-packageehave\model.py", line 1903, in run
          self.func(context, *args, **kwargs)
        File "steps     ests.py", line 18, in step_impl
          context.app.live()
        File "C:\Python27\lib\site-packages\liveandletdie\__init__.py", line 281
, in live
          pid = port_in_use(self.port, kill_port)
        File "C:\Python27\lib\site-packages\liveandletdie\__init__.py", line 100
, in port_in_use
          stdout=subprocess.PIPE)
        File "C:\Python27\lib\subprocess.py", line 710, in __init__
          errread, errwrite)
        File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
          startupinfo)
      WindowsError: [Error 2] The system cannot find the file specified

    When A ping request is made                   # None
    Then The response includes 'hello'            # None


Failing scenarios:
  tests.feature:4  A ping request responds successfully

0 features passed, 1 failed, 0 skipped
0 scenarios passed, 1 failed, 0 skipped
0 steps passed, 1 failed, 2 skipped, 0 undefined
Took 0m0.003s

https://gist.github.com/ramiabughazaleh/300a5e29880a6b1bbd66

@peterhudec
Copy link
Member

It's because the port_in_use() function uses the lsof -iTCP:<port number> -sTCP:LISTEN command which is not available on Windows. Unfortunately I have no Windows installation, so I can not test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants