test: skip some tests if mako not installed
also change corresponding tox env to 'nox' to reflect its "bare-bones" nature and not just a lack of 'db'
This commit is contained in:
parent
2b1c958aa7
commit
7ee8398718
|
@ -3,6 +3,8 @@
|
|||
from unittest import TestCase
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
from wuttjamaican.email import handler as mod
|
||||
from wuttjamaican.email import Message
|
||||
from wuttjamaican.conf import WuttaConfig
|
||||
|
@ -13,6 +15,11 @@ from wuttjamaican.exc import ConfigurationError
|
|||
class TestEmailHandler(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
try:
|
||||
import mako
|
||||
except ImportError:
|
||||
pytest.skip("test not relevant without mako")
|
||||
|
||||
self.config = WuttaConfig()
|
||||
self.app = self.config.get_app()
|
||||
|
||||
|
|
|
@ -398,6 +398,11 @@ class TestAppHandler(FileConfigTestCase):
|
|||
self.assertIsInstance(auth, AuthHandler)
|
||||
|
||||
def test_get_email_handler(self):
|
||||
try:
|
||||
import mako
|
||||
except ImportError:
|
||||
pytest.skip("test not relevant without mako")
|
||||
|
||||
from wuttjamaican.email import EmailHandler
|
||||
|
||||
mail = self.app.get_email_handler()
|
||||
|
@ -409,7 +414,12 @@ class TestAppHandler(FileConfigTestCase):
|
|||
people = self.app.get_people_handler()
|
||||
self.assertIsInstance(people, PeopleHandler)
|
||||
|
||||
def test_get_send_email(self):
|
||||
def test_send_email(self):
|
||||
try:
|
||||
import mako
|
||||
except ImportError:
|
||||
pytest.skip("test not relevant without mako")
|
||||
|
||||
from wuttjamaican.email import EmailHandler
|
||||
|
||||
with patch.object(EmailHandler, 'send_email') as send_email:
|
||||
|
|
Loading…
Reference in a new issue