Travis CI查找和运行测试的Python项目结构应该是什么样的?

编程入门 行业动态 更新时间:2024-10-22 02:38:34
本文介绍了Travis CI查找和运行测试的Python项目结构应该是什么样的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前有一个具有以下.travis.yml文件的项目:

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

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

在本地,tox正确执行并运行35个测试,但是在Travis CI上,它运行 0个测试.

Locally, tox properly executes and runs 35 tests, but on Travis CI, it runs 0 tests.

更多详细信息: travis-ci/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"

他们也找不到任何测试.

我的项目结构为像这样:

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

项目/文件夹的结构是否正确?

Are the project/folders structured incorrectly?

推荐答案

文件夹结构没有问题.

Travis CI上的文件似乎被认为是可执行文件(来自 travis-ci/neverendingqs/pyiterable/builds/79049179 ):

It looks like the files on Travis CI are considered executable (logs from travis-ci/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

我根据使用鼻子"在目录中运行所有测试.修复了一些不相关的错误之后,我能够使测试运行@ travis-ci/neverendingqs/pyiterable/builds/79049983 !

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 @ travis-ci/neverendingqs/pyiterable/builds/79049983!

更多推荐

Travis CI查找和运行测试的Python项目结构应该是什么样的?

本文发布于:2023-11-01 18:01:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550022.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应该是   结构   测试   项目   Travis

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!