使用TOX运行Flake8测试时出现Unicode错误

质子

我是Tox的新手,我想对其进行设置以在我的项目上运行flake8测试,但是当我尝试运行tox时,我一直收到unicode错误。

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 76: ordinal not in range(128)

这是我的tox.ini文件的一瞥:

[tox]
envlist = flake8

[testenv:flake8]
basepython = python2
skip_install = true
deps =
    flake8
commands =
    flake8 -v

# Flake8 Configuration
[flake8]
# Ignore some flake8-docstrings errors
# NOTE(sigmavirus24): While we're still using flake8 2.x, this ignore line
# defaults to selecting all other errors so we do not need select=E,F,W,I,D
# Once Flake8 3.0 is released and in a good state, we can use both and it will
# work well \o/
ignore = D203, E226, E302, E41
exclude =
    .tox,
    .git,
    __pycache__,
    build,
    dist,
    *.pyc,
    *.egg-info,
    .cache,
    .eggs
max-complexity = 10
import-order-style = google
application-import-names = flake8
拉维·库玛(Ravi Kumar)

Tox读取环境变量以获取您的语言的编码信息。

您不能在终端中设置它。(在.bashrc文件中写入以使其永久化)

export LANG=en_US.UTF-8

或将其传递到tox.ini文件中

setenv = LANG=en_US.UTF-8

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何告诉flake8忽略评论

在VSCode中使用Flake8 ...?

PyCharm中的描述性flake8错误

Flake8无法识别内置异常

使用testng运行Rest Assured API测试时出现控制台错误

在Flycheck中使用正确的virtualenv和flake8配置

如何在circle.yml中运行flake8

使用Jasmine和业力为Angular2运行“ npm测试”时出现404错误

如何在标准图中直接使用matplotlib中的Axes3D以避免flake8错误

Flake8报告E999语法错误原子Flake 8

如何关闭所有flake8样式错误并保留程序错误?

运行Rake测试时出现404错误

pylint \ flake8插件无法从pyBuilder运行

运行gradlew测试时出现Robolectric错误

flake8 --diff无法从存储库根目录以外的目录运行

如何使pylint,flake8或pycodestyle自动纠正错误?

在Docker容器中运行`flake8 src`时无输出

并行运行测试时出现错误

从flake8测试中排除.env目录?

运行flake8会给出-AttributeError:“ OptionManager”对象没有属性“ config_options”

在安装和卸载flake8插件后出现错误。执行--help或--version时引发的错误

Angular2-使用PhantomJS运行单元测试时出现配置错误

使用 tox 运行 python 单元测试时遇到问题 - 已安装模块的导入错误

运行测试时测试模块出现Django错误

如何从指定模块导入所有内容而不会出现 flake8 错误

尽管 flake8 测试通过了本地开发环境,但 Travis CI 未能通过 flake8 测试?

运行 tox 时导入不匹配错误

在 tox.ini 中运行 flake8 时调用错误

如何使用 flake8 作为单元测试用例?