我已经为我们的REST API定制了tempest代码,但是当我运行脚本时,在开始使用nosetests时,它会给出一些奇怪的类型错误,如下所述,尽管脚本中的测试用例通过了
Traceback (most recent call last):
File "/usr/lib64/python2.6/logging/__init__.py",line 776, in emit msg = self.format(record)
File "/usr/lib64/python2.6/logging/__init__.py", line 654, in format return fmt.format(record)
File "/home/rmcbuild/repository/rmc-test/tempest/openstack/common/log.py", line 516, in format return logging.Formatter.format(self, record)
File "/usr/lib64/python2.6/logging/__init__.py", line 436, in format record.message = record.getMessage()
File "/usr/lib64/python2.6/logging/__init__.py", line 306, in getMessage msg = msg % self.args
TypeError: not all arguments converted during string formatting
如果有人遇到这种错误,如果有人帮助我,我将不胜感激。
谢谢
使用
%s
打印字符串时会发生这种情况:如果你放一个太多的
%s
,它会给出一个TypeError: not enough arguments for format string
,但是如果你放一个到几个,它会给出TypeError: not all arguments converted during string formatting
。可能的情况是,您在结尾处的括号中插入了一个变量,但是百分比符号的数目不匹配。如果您希望我们进一步帮助您,请张贴您的代码:)
相关问题 更多 >
编程相关推荐