尝试 运行 nosetests 使用 xunit 输出并使用套件

Trying to run nosetests outputing with xunit and using suite

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

.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"/>

当您使用套件时,来自 nosetest 的模块 Xunit 不兼容。

我定制了 xml 并解决了我的问题。