I currently have a project with the following .travis.yml
file:
language: python
install: "pip install tox"
script: "tox"
Locally, tox
properly executes and runs 35 tests, but on Travis CI, it runs 0 tests.
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 project structure is Like This:
- ...
- <module>
- tests (for the module)
- ...
Are the project/folders structured incorrectly?
There was nothing wrong with the folder structure.
It looks like the files on Travis CI are considered executable (logs from 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 changed tox.ini
to run nosetests
with --exe
(nosetests --exe --with-coverage --cover-package=pyiterable
), based on Run all Tests in Directory Using Nose. After fixing some non-related errors, I was able to get the tests to run @ https://travis-ci.org/neverendingqs/pyiterable/builds/79049983!
来源:https://stackoverflow.com/questions/32419241/what-should-a-python-project-structure-look-like-for-travis-ci-to-find-and-run-t