From 663cd81117c02fba3ab3ab31a0f10e7d87176b2f Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Fri, 20 Jan 2012 19:53:41 +0100 Subject: [PATCH] add a test to check deserialization of nonstandard test report attributes --- testing/test_remote.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testing/test_remote.py b/testing/test_remote.py index 96b0d24..2729315 100644 --- a/testing/test_remote.py +++ b/testing/test_remote.py @@ -121,6 +121,23 @@ class TestReportSerialization: if rep.failed: assert newrep.longrepr == str(rep.longrepr) + def test_extended_report_deserialization(self, testdir): + reprec = testdir.inline_runsource("qwe abc") + reports = reprec.getreports("pytest_collectreport") + assert reports + for rep in reports: + rep.extra = True + d = serialize_report(rep) + check_marshallable(d) + newrep = unserialize_report("collectreport", d) + assert newrep.extra + assert newrep.passed == rep.passed + assert newrep.failed == rep.failed + assert newrep.skipped == rep.skipped + if rep.failed: + assert newrep.longrepr == str(rep.longrepr) + + class TestSlaveInteractor: def test_basic_collect_and_runtests(self, slave): p = slave.testdir.makepyfile("""