
try:
    import unittest2 as unittest
except ImportError:
    import unittest

try:
    # this is how you would normally import
    from flask.ext.cors import *
except:
    # support local usage without installed package
    from flask_cors import *


class FlaskCorsTestCase(unittest.TestCase):
    def iter_verbs(self, c):
        ''' A simple helper method to iterate through a range of
            HTTP Verbs and return the test_client bound instance,
            keeping writing our tests as DRY as possible.
        '''
        for verb in ['get', 'head', 'options']:
            yield getattr(c, verb)

    def iter_responses(self, path, verbs=['get', 'head', 'options'], **kwargs):
        with self.app.test_client() as c:
            for verb in verbs:
                yield getattr(c, verb.lower())(path, **kwargs)


class AppConfigTest(object):
    def setUp(self):
        self.app = None

    def tearDown(self):
        self.app = None


try:
    import unittest2 as unittest
except ImportError:
    import unittest

try:
    # this is how you would normally import
    from flask.ext.cors import *
except:
    # support local usage without installed package
    from flask_cors import *


class FlaskCorsTestCase(unittest.TestCase):
    def shortDescription(self):
        """
        Get's the one liner description to be displayed.
        Source:
        http://erikzaadi.com/2012/09/13/inheritance-within-python-unit-tests/
        """
        doc = self._testMethodDoc
        doc = doc and doc.split("\n")[0].strip() or ""
        doc = "%s : %s" % (self.__class__.__name__, doc)
        return doc

    def iter_verbs(self, c):
        ''' A simple helper method to iterate through a range of
            HTTP Verbs and return the test_client bound instance,
            keeping writing our tests as DRY as possible.
        '''
        for verb in ['get', 'head', 'options']:
            yield getattr(c, verb)

    def iter_responses(self, path, verbs=['get', 'head', 'options'], **kwargs):
        with self.app.test_client() as c:
            for verb in verbs:
                yield getattr(c, verb.lower())(path, **kwargs)


class AppConfigTest(object):
    def setUp(self):
        self.app = None

    def tearDown(self):
        self.app = None

Improve testing docstring output for inherited classes
Improve testing docstring output for inherited classes

  
  try:
      import unittest2 as unittest
  except ImportError:
      import unittest
  
  try:
      # this is how you would normally import
      from flask.ext.cors import *
  except:
      # support local usage without installed package
      from flask_cors import *
  
  
  class FlaskCorsTestCase(unittest.TestCase):
+     def shortDescription(self):
+         """
+         Get's the one liner description to be displayed.
+         Source:
+         http://erikzaadi.com/2012/09/13/inheritance-within-python-unit-tests/
+         """
+         doc = self._testMethodDoc
+         doc = doc and doc.split("\n")[0].strip() or ""
+         doc = "%s : %s" % (self.__class__.__name__, doc)
+         return doc
+ 
      def iter_verbs(self, c):
          ''' A simple helper method to iterate through a range of
              HTTP Verbs and return the test_client bound instance,
              keeping writing our tests as DRY as possible.
          '''
          for verb in ['get', 'head', 'options']:
              yield getattr(c, verb)
  
      def iter_responses(self, path, verbs=['get', 'head', 'options'], **kwargs):
          with self.app.test_client() as c:
              for verb in verbs:
                  yield getattr(c, verb.lower())(path, **kwargs)
  
  
  class AppConfigTest(object):
      def setUp(self):
          self.app = None
  
      def tearDown(self):
          self.app = None
  
Improve testing docstring output for inherited classes
## Code Before:

try:
    import unittest2 as unittest
except ImportError:
    import unittest

try:
    # this is how you would normally import
    from flask.ext.cors import *
except:
    # support local usage without installed package
    from flask_cors import *


class FlaskCorsTestCase(unittest.TestCase):
    def iter_verbs(self, c):
        ''' A simple helper method to iterate through a range of
            HTTP Verbs and return the test_client bound instance,
            keeping writing our tests as DRY as possible.
        '''
        for verb in ['get', 'head', 'options']:
            yield getattr(c, verb)

    def iter_responses(self, path, verbs=['get', 'head', 'options'], **kwargs):
        with self.app.test_client() as c:
            for verb in verbs:
                yield getattr(c, verb.lower())(path, **kwargs)


class AppConfigTest(object):
    def setUp(self):
        self.app = None

    def tearDown(self):
        self.app = None

## Instruction:
Improve testing docstring output for inherited classes
## Code After:

try:
    import unittest2 as unittest
except ImportError:
    import unittest

try:
    # this is how you would normally import
    from flask.ext.cors import *
except:
    # support local usage without installed package
    from flask_cors import *


class FlaskCorsTestCase(unittest.TestCase):
    def shortDescription(self):
        """
        Get's the one liner description to be displayed.
        Source:
        http://erikzaadi.com/2012/09/13/inheritance-within-python-unit-tests/
        """
        doc = self._testMethodDoc
        doc = doc and doc.split("\n")[0].strip() or ""
        doc = "%s : %s" % (self.__class__.__name__, doc)
        return doc

    def iter_verbs(self, c):
        ''' A simple helper method to iterate through a range of
            HTTP Verbs and return the test_client bound instance,
            keeping writing our tests as DRY as possible.
        '''
        for verb in ['get', 'head', 'options']:
            yield getattr(c, verb)

    def iter_responses(self, path, verbs=['get', 'head', 'options'], **kwargs):
        with self.app.test_client() as c:
            for verb in verbs:
                yield getattr(c, verb.lower())(path, **kwargs)


class AppConfigTest(object):
    def setUp(self):
        self.app = None

    def tearDown(self):
        self.app = None
