尝试运行xunit和使用套件的鼻子测试输出 [英] Trying to run nosetests outputing with xunit and using suite

查看:168
本文介绍了尝试运行xunit和使用套件的鼻子测试输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用套件在web2py中运行鼻子测试并使用xunit输出,它会创建xml文件,但是即使控制台显示有错误,但也不会将它们写在xml文件中

I'm trying to run nosetests in web2py using suite and outputing with xunit, it creates the xml files but even if the console shows that there were errors, but, they are not been written in the xml file

.py脚本:

suite = TestLoader().loadTestsFromTestClass(globals()[strArchivo+strDirectorio])
            noseargs = ['fake','--processes=0','v=0','--process-timeout=60',
                        '--with-xunit', '--xunit-file=applications/output.xml','--verbosity=0']

            nose.run(argv = noseargs,suite = suite)

控制台输出:

web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2015
Version 2.12.3-stable+timestamp.2015.08.19.00.18.03
Database drivers available: sqlite3, imaplib, pymysql, pg8000
INFO:urllib3.connectionpool:Starting new HTTP connection (1): servicio
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"POST /servicios/hotel_servicio/call/json/inserHotel/ HTTP/1.1" 200 None
INFO:urllib3.connectionpool:Starting new HTTP connection (1): servicio
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"POST /servicios/hotel_servicio/call/json/listHotel/ HTTP/1.1" 200 None
INFO:urllib3.connectionpool:Starting new HTTP connection (1): servicio
DEBUG:urllib3.connectionpool:Setting read timeout to None
DEBUG:urllib3.connectionpool:"POST /servicios/hotel_servicio/call/json/listHotel/ HTTP/1.1" 403 13
======================================================================
FAIL: Esta definicion comprobara de que en caso de no poseer la llave
----------------------------------------------------------------------
Traceback (most recent call last):
  File "applications/apprueba/test/controllers/default.py", line 42, in test_ListarHotelesSinLlave
    self.assertTrue(resp['jsonBoolean'],'Devolvio json')
AssertionError: Devolvio json

----------------------------------------------------------------------
Ran 4 tests in 0.344s

FAILED (failures=1)

xml文件:

<testsuite name="nosetests" tests="0" errors="0" failures="0" skip="0"/>

推荐答案

使用套件时,鼻子测试模块Xunit不兼容.

The module Xunit from nosetest is not compatible when you are using suites.

我制作了一个自定义xml并解决了我的问题.

I made a custom xml and solved my problem.

这篇关于尝试运行xunit和使用套件的鼻子测试输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆