code: def test_unexpected_success_subtests(self):
      # Success in all subtests counts as the unexpected success of
      # the whole test.
      class Foo(unittest.TestCase):
          @unittest.expectedFailure
          def test_die(self):
              with self.subTest():
                  # This one succeeds
                  pass
              with self.subTest():
                  # So does this one
                  pass
  
      events = []
      result = LoggingResult(events)
      test = Foo("test_die")
      self.assertIs(test.run(result), result)
      self.assertEqual(
          events,
          [
              "startTest",
              "addSubTestSuccess",
              "addSubTestSuccess",
              "addUnexpectedSuccess",
              "stopTest",
          ],
      )
      self.assertFalse(result.failures)
      self.assertFalse(result.expectedFailures)
      self.assertEqual(result.unexpectedSuccesses, [test])
      self.assertFalse(result.wasSuccessful())
  
imports: import unittest
  from test.test_unittest.support import LoggingResult
label_desc: Use image node_id 17 for calling the Test_TestSkipping obj's underlying member method code with example usage: obj.test_unexpected_success_subtests() without return types