What should be the structure of the Python project for Travis CI for finding and running tests?

I currently have a project with the following .travis.yml file:

 language: python install: "pip install tox" script: "tox" 

Locally, tox correctly executes and runs 35 tests, but 0 tests are run on Travis CI.

More details: https://travis-ci.org/neverendingqs/pyiterable/builds/78954867

I also tried other ways, including:

 language: python python: - "2.6" - "2.7" - "3.2" - "3.3" - "3.4" - "3.5.0b3" - "3.5-dev" - "nightly" # also fails with just `nosetest` and no `install` step install: "pip install coverage unittest2" script: "nosetests --with-coverage --cover-package=pyiterable" 

They also could not find any tests .

My Like This project structure:

 - ... - <module> - tests (for the module) - ... 

Are the project / folders structured incorrectly?

+6
source share
1 answer

There was nothing wrong with the folder structure.

Files on Travis CI seem to be considered executable (logs https://travis-ci.org/neverendingqs/pyiterable/builds/79049179 ):

 nosetests --verbosity=3 nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$'] nose.selector: INFO: /home/travis/build/neverendingqs/pyiterable/LICENSE.txt is executable; skipped nose.selector: INFO: /home/travis/build/neverendingqs/pyiterable/pyiterable/iterable.py is executable; skipped nose.selector: INFO: /home/travis/build/neverendingqs/pyiterable/readme.md is executable; skipped nose.selector: INFO: /home/travis/build/neverendingqs/pyiterable/setup.cfg is executable; skipped nose.selector: INFO: /home/travis/build/neverendingqs/pyiterable/tox.ini is executable; skipped nose.selector: INFO: /home/travis/build/neverendingqs/pyiterable/tests/test_iterable.py is executable; skipped 

I modified tox.ini to run nosetests using --exe ( nosetests --exe --with-coverage --cover-package=pyiterable ), based on Run all tests in the directory using the nose . After fixing some unrelated errors, I was able to run the tests @ https://travis-ci.org/neverendingqs/pyiterable/builds/79049983 !

+2
source

All Articles