Python unittest discover works over SSH but not from circle.yml

python
circle.yml

#1

Hi,

I tried to add a unit test to one of my deployment scripts - this works locally and if I connect to CircleCI over SSH, however trying to run it from the circle.yml file results in Python throwing import errors despite the context appearing to be equivalent, the script being run from the same path, etc.

The structure of my project is as such (with names substituted to protect the innocent):

project
project/deployment
project/deployment/source
project/deployment/test

CircleCI starts in the project folder by default so the scripts are executed under test: override: as

  • cd deployment
  • python -m unittest discover

Running this sequence of commands from SSH and locally successfully discovers and runs my test, however running from circle.yml causes an error ‘No such module source.mymodule’

This appears to be related to this topic: Python nose2 unit tests with circle.yml

Thank you for your attention.

edit: this is with Python 2.7.11


#2

Link/snippet of circle.yml available? Or can you PM a link to the build (if it’s private).


#3