import unittest
import logging
from reporter import setup_logger

setup_logger()
LOGGER = logging.getLogger('osm-reporter')


class LoggedTestCase(unittest.TestCase):
    """A test class that logs to sentry on failure."""
    def failureException(self, msg):
        """Overloaded failure exception that will log to sentry.

        Args:
            msg: str - a string containing a message for the log entry.

        Returns:
            delegates to TestCase and returns the exception generated by it.

        Raises:
            see unittest.TestCase

        """
        LOGGER.exception(msg)
        return self.super(LoggedTestCase, self).failureException(msg)

import unittest
import logging
from reporter import setup_logger

setup_logger()
LOGGER = logging.getLogger('osm-reporter')


class LoggedTestCase(unittest.TestCase):
    """A test class that logs to sentry on failure."""
    def failureException(self, msg):
        """Overloaded failure exception that will log to sentry.

        :param msg: String containing a message for the log entry.
        :type msg: str

        :returns: delegates to TestCase and returns the exception generated
            by it.
        :rtype: Exception

        See unittest.TestCase to see what gets raised.
        """
        LOGGER.exception(msg)
        return super(LoggedTestCase, self).failureException(msg)

Fix for calling super during exception logging
Fix for calling super during exception logging

  import unittest
  import logging
  from reporter import setup_logger
  
  setup_logger()
  LOGGER = logging.getLogger('osm-reporter')
  
  
  class LoggedTestCase(unittest.TestCase):
      """A test class that logs to sentry on failure."""
      def failureException(self, msg):
          """Overloaded failure exception that will log to sentry.
  
-         Args:
-             msg: str - a string containing a message for the log entry.
+         :param msg: String containing a message for the log entry.
+         :type msg: str
  
-         Returns:
-             delegates to TestCase and returns the exception generated by it.
+         :returns: delegates to TestCase and returns the exception generated
+             by it.
+         :rtype: Exception
  
+         See unittest.TestCase to see what gets raised.
-         Raises:
-             see unittest.TestCase
- 
          """
          LOGGER.exception(msg)
-         return self.super(LoggedTestCase, self).failureException(msg)
+         return super(LoggedTestCase, self).failureException(msg)
  
Fix for calling super during exception logging
## Code Before:
import unittest
import logging
from reporter import setup_logger

setup_logger()
LOGGER = logging.getLogger('osm-reporter')


class LoggedTestCase(unittest.TestCase):
    """A test class that logs to sentry on failure."""
    def failureException(self, msg):
        """Overloaded failure exception that will log to sentry.

        Args:
            msg: str - a string containing a message for the log entry.

        Returns:
            delegates to TestCase and returns the exception generated by it.

        Raises:
            see unittest.TestCase

        """
        LOGGER.exception(msg)
        return self.super(LoggedTestCase, self).failureException(msg)

## Instruction:
Fix for calling super during exception logging
## Code After:
import unittest
import logging
from reporter import setup_logger

setup_logger()
LOGGER = logging.getLogger('osm-reporter')


class LoggedTestCase(unittest.TestCase):
    """A test class that logs to sentry on failure."""
    def failureException(self, msg):
        """Overloaded failure exception that will log to sentry.

        :param msg: String containing a message for the log entry.
        :type msg: str

        :returns: delegates to TestCase and returns the exception generated
            by it.
        :rtype: Exception

        See unittest.TestCase to see what gets raised.
        """
        LOGGER.exception(msg)
        return super(LoggedTestCase, self).failureException(msg)
