def test_onlyOldStyleMayBeDecorated(self):
        """
        Using L{_oldstyle._oldStyle} on a new-style class on Python 2 will
        raise an exception.
        """
        with self.assertRaises(ValueError) as e:
            _oldstyle._oldStyle(SomeNewStyleClass)

        self.assertEqual(
            e.exception.args[0],
            ("twisted.python._oldstyle._oldStyle is being used to decorate a "
             "new-style class (twisted.test.test_nooldstyle.SomeNewStyleClass)"
             ". This should only be used to decorate old-style classes."))

        Using L{_oldstyle._oldStyle} on a new-style class on Python 2 will
        raise an exception.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_nooldstyle.py