samedi 6 janvier 2018

pytest-bdd looks for tests in a different drive on windows

I have two files in the same directory (G:\<DIRECTORY>):

trial.feature contains:

Feature: trial
  Scenario: a test
    Given something
    Then run trial

test_trial.py contains:

from pytest_bdd import given, when, then, parsers
from pytest_bdd import scenarios

scenarios('trial.feature')

@given('something')
def something():
    return 1


@then('run trial')
def run_trial(something):
    assert something == 1

If I navigate to this directory and run pytest ., it cannot find the files and returns the message:

E FileNotFoundError: [Errno 2] No such file or directory: 'C:\<DIRECTORY>\\trial.feature'

It appears pytest is searching in a different drive C: not where it should be G:

Aucun commentaire:

Enregistrer un commentaire