Pytest does not find pyYAML in Travis CI tests that have PyPI

as title suggests, here is my current .travis.yml file, this is concurrent with my android problem I posted:

am currently trying to do this using this .travis.yml file:

language: python
python:
  - "3.6"
  - "3.7"
  - "3.8"
# command to install dependencies
install:
  - sudo apt-get update
  - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
  - bash miniconda.sh -b -p $HOME/miniconda
  - source "$HOME/miniconda/etc/profile.d/conda.sh"
  - hash -r
  - conda config --set always_yes yes --set changeps1 no
  - conda update -q conda
  # Useful for debugging any issues with conda
  - conda info -a
  - conda env create -f tests/test-environment.yml python=$TRAVIS_PYTHON_VERSION
  - conda activate test-environment
  - conda install pip
  - conda install -c conda-forge iris
  - pip install -r requirements.txt
  - pip install .
# command to run tests
script: pytest

thanks

For reference, pytest is installed in requirements.txt. For debugging purposes I would change

- script: pytest

To

- script: echo $(which pytest) && pytest

Make sure the env path printed is /home/travis/miniconda/envs/test-environment/bin/pytest. If you’re not sure – you can grep this out. There doesn’t seem to be any Docker conditions, so that wouldn’t be an issue either.

What you need to do is explicitly enforce pytest in the requirements.txt. Once you enforce this, this should get you going.

ended up doing

-script: echo $(which pytest && pytest) 

worked like a charm @Montana

Glad enforcing this worked, this was my initial hunch but couldn’t be certain until being applied to your particular use case.

If you need any more help from me or others in the community please reach out and myself or somebody else will get you in the right direction.