def _endProcess(self, reason, p):
        """
        Check that a failed write prevented the process from getting to its
        custom exit code.
        """
        # child must not get past that write without raising
        self.assertNotEqual(
            reason.exitCode, 42, 'process reason was %r' % reason)
        self.assertEqual(p.output, b'')
        return p.errput

        Check that a failed write prevented the process from getting to its
        custom exit code.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py