code: def test_context_vars(self):
      cv = contextvars.ContextVar("cv", default=0)
  
      coro_first_step_ran = False
      coro_second_step_ran = False
  
      async def coro():
          nonlocal coro_first_step_ran
          nonlocal coro_second_step_ran
          self.assertEqual(cv.get(), 1)
          cv.set(2)
          self.assertEqual(cv.get(), 2)
          coro_first_step_ran = True
          await asyncio.sleep(0.1)
          self.assertEqual(cv.get(), 2)
          cv.set(3)
          self.assertEqual(cv.get(), 3)
          coro_second_step_ran = True
  
      async def run():
          cv.set(1)
          t = self.loop.create_task(coro())
          self.assertTrue(coro_first_step_ran)
          self.assertFalse(coro_second_step_ran)
          self.assertEqual(cv.get(), 1)
          await t
          self.assertTrue(coro_second_step_ran)
          self.assertEqual(cv.get(), 1)
  
      self.run_coro(run())
  
imports: import asyncio
  import contextvars
  import unittest
  from unittest import mock
  from asyncio import tasks
  from test.test_asyncio import utils
  from test.support.script_helper import assert_python_ok
label_desc: Use image node_id 12 for calling the EagerTaskFactoryLoopTests obj's underlying member method code with example usage: obj.test_context_vars() without return types