import sys
try:
    # noinspection PyPackageRequirements
    import unittest2 as unittest
    sys.modules['unittest'] = unittest
except ImportError:
    import unittest

from goless.backends import current as be


class BaseTests(unittest.TestCase):
    """
    Base class for unit tests.
    Yields in setup and teardown so no lingering tasklets
    are run in a later test,
    potentially causing an error that would leave people scratching their heads.
    """

    def setUp(self):
        be.yield_()

    def tearDown(self):
        be.yield_()
        self.assertTrue(be.would_deadlock())

import sys
try:
    # noinspection PyPackageRequirements
    import unittest2 as unittest
    sys.modules['unittest'] = unittest
except ImportError:
    import unittest

from goless.backends import current as be


class BaseTests(unittest.TestCase):
    """
    Base class for unit tests.
    Yields in setup and teardown so no lingering tasklets
    are run in a later test,
    potentially causing an error that would leave people scratching their heads.
    """

    def setUp(self):
        be.yield_()

    def tearDown(self):
        be.yield_()
        self.assertTrue(be.would_deadlock(), 'Task(s) still running after test finished')

Add comment in BaseTests tearDown
Add comment in BaseTests tearDown

  import sys
  try:
      # noinspection PyPackageRequirements
      import unittest2 as unittest
      sys.modules['unittest'] = unittest
  except ImportError:
      import unittest
  
  from goless.backends import current as be
  
  
  class BaseTests(unittest.TestCase):
      """
      Base class for unit tests.
      Yields in setup and teardown so no lingering tasklets
      are run in a later test,
      potentially causing an error that would leave people scratching their heads.
      """
  
      def setUp(self):
          be.yield_()
  
      def tearDown(self):
          be.yield_()
-         self.assertTrue(be.would_deadlock())
+         self.assertTrue(be.would_deadlock(), 'Task(s) still running after test finished')
  
Add comment in BaseTests tearDown
## Code Before:
import sys
try:
    # noinspection PyPackageRequirements
    import unittest2 as unittest
    sys.modules['unittest'] = unittest
except ImportError:
    import unittest

from goless.backends import current as be


class BaseTests(unittest.TestCase):
    """
    Base class for unit tests.
    Yields in setup and teardown so no lingering tasklets
    are run in a later test,
    potentially causing an error that would leave people scratching their heads.
    """

    def setUp(self):
        be.yield_()

    def tearDown(self):
        be.yield_()
        self.assertTrue(be.would_deadlock())

## Instruction:
Add comment in BaseTests tearDown
## Code After:
import sys
try:
    # noinspection PyPackageRequirements
    import unittest2 as unittest
    sys.modules['unittest'] = unittest
except ImportError:
    import unittest

from goless.backends import current as be


class BaseTests(unittest.TestCase):
    """
    Base class for unit tests.
    Yields in setup and teardown so no lingering tasklets
    are run in a later test,
    potentially causing an error that would leave people scratching their heads.
    """

    def setUp(self):
        be.yield_()

    def tearDown(self):
        be.yield_()
        self.assertTrue(be.would_deadlock(), 'Task(s) still running after test finished')
