docstr: Regression test for tracebacks without a reprcrash (#5971)
  
  This happens notably on exceptions raised by multiprocess.pool: the exception transfer
  from subprocess to main process creates an artificial exception, which ExceptionInfo
  can't obtain the ReprFileLocation from.
docstr_tok: ["Regression","test","for","tracebacks","without","a","reprcrash","(","#","5971",")","This","happens","notably","on","exceptions","raised","by","multiprocess.pool",":","the","exception","transfer","from","subprocess","to","main","process","creates","an","artificial","exception",",","which","ExceptionInfo","ca","n't","obtain","the","ReprFileLocation","from","."]
code: def test_chained_exceptions_no_reprcrash(
      self, pytester: Pytester, tw_mock
  ) -> None:
      """Regression test for tracebacks without a reprcrash (#5971)
  
      This happens notably on exceptions raised by multiprocess.pool: the exception transfer
      from subprocess to main process creates an artificial exception, which ExceptionInfo
      can't obtain the ReprFileLocation from.
      """
      pytester.makepyfile(
          """
              from concurrent.futures import ProcessPoolExecutor
  
              def func():
                  raise ValueError('value error')
  
              def test_a():
                  with ProcessPoolExecutor() as p:
                      p.submit(func).result()
          """
      )
  
      pytester.syspathinsert()
      reprec = pytester.inline_run()
  
      reports = reprec.getreports("pytest_runtest_logreport")
  
      def check_longrepr(longrepr: object) -> None:
          assert isinstance(longrepr, ExceptionChainRepr)
          assert len(longrepr.chain) == 2
          entry1, entry2 = longrepr.chain
          tb1, fileloc1, desc1 = entry1
          tb2, fileloc2, desc2 = entry2
  
          assert "RemoteTraceback" in str(tb1)
          assert "ValueError: value error" in str(tb2)
  
          assert fileloc1 is None
          assert fileloc2 is not None
          assert fileloc2.message == "ValueError: value error"
  
      # 3 reports: setup/call/teardown: get the call report
      assert len(reports) == 3
      report = reports[1]
  
      assert report.failed
      check_longrepr(report.longrepr)
  
      data = report._to_json()
      loaded_report = TestReport._from_json(data)
  
      assert loaded_report.failed
      check_longrepr(loaded_report.longrepr)
  
      # for same reasons as previous test, ensure we don't blow up here
      assert loaded_report.longrepr is not None
      assert isinstance(loaded_report.longrepr, ExceptionChainRepr)
      loaded_report.longrepr.toterminal(tw_mock)
  
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 12 for calling the TestReportSerialization obj's underlying member method code with example usage: obj.test_chained_exceptions_no_reprcrash(pytester, tw_mock) without return types