reintroduce --junit - i think it is actually useful
--HG-- branch : trunk
This commit is contained in:
parent
af5e18e26c
commit
37a2898f18
13
CHANGELOG
13
CHANGELOG
|
@ -28,11 +28,14 @@ New features
|
|||
def test_function(arg):
|
||||
...
|
||||
|
||||
- customizable error reporting: allow custom error reporting for
|
||||
custom (test and particularly collection) nodes by always calling
|
||||
``node.repr_failure(excinfo)`` which you may override to return a
|
||||
string error representation of your choice which is going to be
|
||||
reported as a (red) string.
|
||||
- improved error reporting when collection errors appear.
|
||||
In general, for custom (test and particularly collection)
|
||||
nodes ``node.repr_failure(excinfo)`` is now called so that you can
|
||||
override it to return a string error representation of your choice
|
||||
which is going to be reported as a (red) string.
|
||||
|
||||
- introduce '--junitprefix=STR' option to prepend a prefix
|
||||
to all reports in the junitxml file.
|
||||
|
||||
Bug fixes / Maintenance
|
||||
++++++++++++++++++++++++++
|
||||
|
|
|
@ -11,15 +11,14 @@ def pytest_addoption(parser):
|
|||
group.addoption('--junitxml', action="store", dest="xmlpath",
|
||||
metavar="path", default=None,
|
||||
help="create junit-xml style report file at given path.")
|
||||
# probalby YAGNI, therefore commented out:
|
||||
#group.addoption('--junitprefix', action="store", dest="junitprefix",
|
||||
# metavar="str", default=None,
|
||||
# help="prepend prefix to classnames in junit-xml output")
|
||||
group.addoption('--junitprefix', action="store", dest="junitprefix",
|
||||
metavar="str", default=None,
|
||||
help="prepend prefix to classnames in junit-xml output")
|
||||
|
||||
def pytest_configure(config):
|
||||
xmlpath = config.option.xmlpath
|
||||
if xmlpath:
|
||||
config._xml = LogXML(xmlpath, None) # config.option.junitprefix)
|
||||
config._xml = LogXML(xmlpath, config.option.junitprefix)
|
||||
config.pluginmanager.register(config._xml)
|
||||
|
||||
def pytest_unconfigure(config):
|
||||
|
|
|
@ -119,7 +119,7 @@ class TestPython:
|
|||
classname="test_failure_escape.test_failure_escape",
|
||||
name="test_func[&]")
|
||||
|
||||
def YAGNI_test_junit_prefixing(self, testdir):
|
||||
def test_junit_prefixing(self, testdir):
|
||||
testdir.makepyfile("""
|
||||
def test_func():
|
||||
assert 0
|
||||
|
|
Loading…
Reference in New Issue