move akismet imports, in case the package is not installed
diff --git a/Allura/allura/lib/spam/akismetfilter.py b/Allura/allura/lib/spam/akismetfilter.py
index 9f22199..34caaae 100644
--- a/Allura/allura/lib/spam/akismetfilter.py
+++ b/Allura/allura/lib/spam/akismetfilter.py
@@ -17,7 +17,6 @@
 
 import logging
 
-from akismet import CheckResponse
 from tg import request
 from tg import tmpl_context as c
 
@@ -113,7 +112,7 @@
                                                          content_type=content_type,
                                                          request=request,
                                                          ))
-        spam = res != CheckResponse.HAM
+        spam = res != akismet.CheckResponse.HAM
         self.record_result(spam, artifact, user)
         return res
 
diff --git a/Allura/allura/tests/unit/spam/test_akismet.py b/Allura/allura/tests/unit/spam/test_akismet.py
index 20a205f..ca56f67 100644
--- a/Allura/allura/tests/unit/spam/test_akismet.py
+++ b/Allura/allura/tests/unit/spam/test_akismet.py
@@ -17,23 +17,24 @@
 
 
 import mock
-import unittest
+import pytest
 import six.moves.urllib.request
 import six.moves.urllib.parse
 import six.moves.urllib.error
 from datetime import datetime
 
-from akismet import CheckResponse
 from bson import ObjectId
 
 from allura.lib.spam.akismetfilter import AKISMET_AVAILABLE, AkismetSpamFilter
 
 
-@unittest.skipIf(not AKISMET_AVAILABLE, "Akismet not available")
-class TestAkismet(unittest.TestCase):
+@pytest.mark.skipif(not AKISMET_AVAILABLE, reason="Akismet not available")
+class TestAkismet:
 
     @mock.patch('allura.lib.spam.akismetfilter.akismet')
     def setup_method(self, method, akismet_lib):
+        from akismet import CheckResponse
+
         self.akismet = AkismetSpamFilter({'spam.key': 'example', 'base_url': 'http://localhost/'})
 
         def side_effect(*args, **kw):