]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- py3k fix
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 15 Sep 2014 01:06:27 +0000 (21:06 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 15 Sep 2014 01:06:27 +0000 (21:06 -0400)
alembic/testing/plugin/noseplugin.py

index 3235d4fbbfa9630db4a859d54763c5966602b287..bb96d061bf720977185b7289d16ef72e9a300da9 100644 (file)
@@ -71,6 +71,8 @@ class NoseSQLAlchemy(Plugin):
 
     def wantMethod(self, fn):
         if py3k:
+            if not hasattr(fn.__self__, 'cls'):
+                return False
             cls = fn.__self__.cls
         else:
             cls = fn.im_class
@@ -80,9 +82,10 @@ class NoseSQLAlchemy(Plugin):
         return plugin_base.want_class(cls)
 
     def beforeTest(self, test):
-        plugin_base.before_test(test,
-                                test.test.cls.__module__,
-                                test.test.cls, test.test.method.__name__)
+        plugin_base.before_test(
+            test,
+            test.test.cls.__module__,
+            test.test.cls, test.test.method.__name__)
 
     def afterTest(self, test):
         plugin_base.after_test(test)