Skip to content

Commit 86f2963

Browse files
author
cclauss
authored
使用Travis CI对拉请求进行自动测试
持续集成将允许我们在合并前对所有请求进行测试。 ApacheCN项目是否使用任何自动化测试系统,如[Travis CI](https://www.travis-ci.com),[Circle CI](https://www.circleci.com),[AppVeyor](http://ci.appveyor.com)? 如果存在Python语法错误或未定义的名称,http://flake8.pycqa.org将标记Travis CI构建。 E901,E999,F821,F822,F823是可以通过SyntaxError,NameError等停止运行时的“showstopper”问题。大多数其他flake8问题仅仅是“样式违规” - 对于可读性很有用,但它们不影响运行时 安全。 因此,该PR建议在整个代码库上对这些测试进行flake8运行。 F821:未定义的名称 F822:__all__中的未定义名称 F823:分配前引用的局部变量名称 E901:SyntaxError或IndentationError E999:SyntaxError - 无法将文件编译到抽象语法树中
1 parent 85fc413 commit 86f2963

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.travis.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
group: travis_latest
2+
language: python
3+
cache: pip
4+
python:
5+
- 2.7
6+
- 3.7
7+
#- nightly
8+
#- pypy
9+
#- pypy3
10+
matrix:
11+
allow_failures:
12+
- python: 2.7
13+
- python: nightly
14+
- python: pypy
15+
- python: pypy3
16+
install:
17+
#- pip install -r requirements.txt
18+
- pip install flake8 # pytest # add another testing frameworks later
19+
before_script:
20+
# stop the build if there are Python syntax errors or undefined names
21+
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
22+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
23+
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
24+
script:
25+
- true # pytest --capture=sys # add other tests here
26+
notifications:
27+
on_success: change
28+
on_failure: change # `always` will be the setting once code changes slow down

0 commit comments

Comments
 (0)