我正在使用 xml 测试运行程序在单元测试后生成 xml 报告:
https://pypi.python.org/pypi/XmlTestRunner
但是,我只是一个错误:
SyntaxError ( ('future feature unicode_literals is not defined'
如果您查看脚本,您可以看到以下行:
from __future__ import unicode_literals
unicode_literals
导入有什么问题?
最佳答案
您使用的 Python 版本似乎早于 2.6.0。 unicode_literals
future import 首次出现在 2.6.0 中。
如果您希望脚本运行,请将您的 Python 升级到更新版本。
关于python - 在 python 中使用 xml 测试运行程序时出现脚本错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31563593/