code: def test_itemreport_outcomes(self, pytester: Pytester) -> None:
      # This test came originally from test_remote.py in xdist (ca03269).
      reprec = pytester.inline_runsource(
          """
              import pytest
              def test_pass(): pass
              def test_fail(): 0/0
              @pytest.mark.skipif("True")
              def test_skip(): pass
              def test_skip_imperative():
                  pytest.skip("hello")
              @pytest.mark.xfail("True")
              def test_xfail(): 0/0
              def test_xfail_imperative():
                  pytest.xfail("hello")
          """
      )
      reports = reprec.getreports("pytest_runtest_logreport")
      assert len(reports) == 17  # with setup/teardown "passed" reports
      for rep in reports:
          d = rep._to_json()
          newrep = TestReport._from_json(d)
          assert newrep.passed == rep.passed
          assert newrep.failed == rep.failed
          assert newrep.skipped == rep.skipped
          if newrep.skipped and not hasattr(newrep, "wasxfail"):
              assert isinstance(newrep.longrepr, tuple)
              assert len(newrep.longrepr) == 3
          assert newrep.outcome == rep.outcome
          assert newrep.when == rep.when
          assert newrep.keywords == rep.keywords
          if rep.failed:
              assert newrep.longreprtext == rep.longreprtext
  
imports: from typing import Sequence
  from typing import Union
  import pytest
  from _pytest._code.code import ExceptionChainRepr
  from _pytest._code.code import ExceptionRepr
  from _pytest.config import Config
  from _pytest.pytester import Pytester
  from _pytest.python_api import approx
  from _pytest.reports import CollectReport
  from _pytest.reports import TestReport
label_desc: Use image node_id 5 for calling the TestReportSerialization obj's underlying member method code with example usage: obj.test_itemreport_outcomes(pytester) without return types