code: def test_expected_failure_subtests(self):
      # A failure in any subtest counts as the expected failure of the
      # whole test.
      class Foo(unittest.TestCase):
          @unittest.expectedFailure
          def test_die(self):
              with self.subTest():
                  # This one succeeds
                  pass
              with self.subTest():
                  self.fail("help me!")
              with self.subTest():
                  # This one doesn't get executed
                  self.fail("shouldn't come here")
  
      events = []
      result = LoggingResult(events)
      test = Foo("test_die")
      self.assertIs(test.run(result), result)
      self.assertEqual(
          events,
          [
              "startTest",
              "addSubTestSuccess",
              "addExpectedFailure",
              "stopTest",
          ],
      )
      self.assertFalse(result.failures)
      self.assertEqual(len(result.expectedFailures), 1)
      self.assertIs(result.expectedFailures[0][0], test)
      self.assertFalse(result.unexpectedSuccesses)
      self.assertTrue(result.wasSuccessful())
  
imports: import unittest
  from test.test_unittest.support import LoggingResult
label_desc: Use image node_id 13 for calling the Test_TestSkipping obj's underlying member method code with example usage: obj.test_expected_failure_subtests() without return types