Hello everyone, I am having some trouble running t...
# connector-development
i
Hello everyone, I am having some trouble running the unit tests in some of the source connectors. When I run _*python3 -m pytest -s unit_tests*_ what I am getting is E fixture 'requests_mock' not found
available fixtures: api, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, common_params, config, creds_with_wrong_permissions, doctest_namespace, fake_properties_list, monkeypatch, oauth_config, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, some_credentials, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
use 'pytest --fixtures [testpath]' for help on them.
Some initial investigation implies that the requests mock decorator is not recognized in python 3 which seem pretty weird since according to the docs the supported Python version for Airbyte is > 3.7 On my local machine python3 --version resolves to Python 3.7.5
m
@Ivica Taseski please follow instructions in the readme and install pyenv and install all libraries the connector needs
i
if you are referring to the following instructions then I have already done that
cd airbyte-integrations/connectors/source-<name> python -m venv .venv # Create a virtual environment in the .venv directory source .venv/bin/activate # enable the venv pip install -r requirements.txt
any idea on what else might be causing this?
n
Maybe those commands with python3 and pip3?
i
the commands were copied from the docs. locally I was using python3 :)
I have tried force reinstalling the packages with pip3 install -r requirements.txt --force-reinstall but that doesn't solve the issue as well.
s
@Ivica Taseski from the virtual env, can you run
pip install ".[tests]"
?
test dependencies are defined as extras in
setup.py
and should be installed as described under the Unit Tests section of the README e.g: https://github.com/airbytehq/airbyte/tree/master/airbyte-integrations/connectors/source-asana#testing
i
Thanks a lot @Sherif Nada running pip install ".[tests]" solves the issue 🙂