Permalink
Browse files

Merge branch 'release/4.0.0' into develop

  • Loading branch information...
2 parents c2245a7 + 5229955 commit 293f8f0d9d97af58a845e2fd4495edfa498e0d63 @amcgregor amcgregor committed Nov 23, 2011
View
@@ -8,6 +8,6 @@
__all__ = ['version_info', 'version']
-version_info = namedtuple('version_info', ('major', 'minor', 'micro', 'releaselevel', 'serial'))(4, 0, 0, 'beta', 3)
+version_info = namedtuple('version_info', ('major', 'minor', 'micro', 'releaselevel', 'serial'))(4, 0, 0, 'final', 0)
version = ".".join([str(i) for i in version_info[:3]]) + ((version_info.releaselevel[0] + str(version_info.serial)) if version_info.releaselevel != 'final' else '')
View
@@ -3,13 +3,17 @@
import os
import sys
+import warnings
from setuptools import setup, find_packages
if sys.version_info < (2, 6):
raise SystemExit("Python 2.6 or later is required.")
+if sys.version_info > (3, 0):
+ warnings.warn("Marrow Mailer is untested on Python 3; some features may be broken.", RuntimeWarning)
+
exec(open(os.path.join("marrow", "mailer", "release.py")).read())
@@ -27,7 +31,7 @@
author = "Alice Bevan-McGregor",
author_email = "alice+marrow@gothcandy.com",
- url = "https://github.com/marrow/marrow.wsgi.objects",
+ url = "https://github.com/marrow/marrow.mailer",
license = "MIT",
install_requires = [
@@ -42,20 +46,22 @@
'PyDNS',
'transaction',
'pymta'
- ],
+ ] + [
+ 'futures'
+ ] if sys.version_info < (3, 0) else [],
classifiers=[
- "Development Status :: 4 - Beta",
+ "Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
- "Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.1",
- "Programming Language :: Python :: 3.2",
+ # "Programming Language :: Python :: 3",
+ # "Programming Language :: Python :: 3.1",
+ # "Programming Language :: Python :: 3.2",
"Topic :: Software Development :: Libraries :: Python Modules"
],
@@ -71,7 +77,7 @@
'immediate = marrow.mailer.manager.immediate:ImmediateManager',
'futures = marrow.mailer.manager.futures:FuturesManager',
'dynamic = marrow.mailer.manager.dynamic:DynamicManager',
- 'transactional = marrow.mailer.manager.transactional:TransactionalDynamicManager'
+ # 'transactional = marrow.mailer.manager.transactional:TransactionalDynamicManager'
],
'marrow.mailer.transport': [
'amazon = marrow.mailer.transport.ses:AmazonTransport',
@@ -68,7 +68,7 @@ def test_exception(self):
self.wi.fn = lambda: 1/0
self.wi.run()
- self.assertIsInstance(self.f.exception, ZeroDivisionError)
+ self.assertTrue(isinstance(self.f.exception, ZeroDivisionError))
class ManagerTestCase(TestCase):
View
@@ -42,9 +42,9 @@ def test_deprecation(self):
self.assertEqual(len(w), 1, "No, or more than one, warning issued.")
self.assertTrue(issubclass(w[-1].category, DeprecationWarning), "Category of warning is not DeprecationWarning.")
- self.assertIn('deprecated', str(w[-1].message), "Warning does not include 'deprecated'.")
- self.assertIn('Mailer', str(w[-1].message), "Warning does not include correct class name.")
- self.assertIn('Delivery', str(w[-1].message), "Warning does not include old class name.")
+ self.assertTrue('deprecated' in str(w[-1].message), "Warning does not include 'deprecated'.")
+ self.assertTrue('Mailer' in str(w[-1].message), "Warning does not include correct class name.")
+ self.assertTrue('Delivery' in str(w[-1].message), "Warning does not include old class name.")
def test_use_deprecation(self):
with warnings.catch_warnings(record=True) as w:
@@ -55,12 +55,12 @@ def test_use_deprecation(self):
self.assertEqual(len(w), 2, "Too few or too many warnings issued.")
self.assertTrue(issubclass(w[0].category, DeprecationWarning), "Category of warning is not DeprecationWarning.")
- self.assertIn('deprecated', str(w[0].message), "Warning does not include 'deprecated'.")
- self.assertIn('manager.use', str(w[0].message), "Warning does not include correct use.")
+ self.assertTrue('deprecated' in str(w[0].message), "Warning does not include 'deprecated'.")
+ self.assertTrue('manager.use' in str(w[0].message), "Warning does not include correct use.")
self.assertTrue(issubclass(w[1].category, DeprecationWarning), "Category of warning is not DeprecationWarning.")
- self.assertIn('deprecated', str(w[1].message), "Warning does not include 'deprecated'.")
- self.assertIn('transport.use', str(w[1].message), "Warning does not include correct use.")
+ self.assertTrue('deprecated' in str(w[1].message), "Warning does not include 'deprecated'.")
+ self.assertTrue('transport.use' in str(w[1].message), "Warning does not include correct use.")
def test_standard(self):
log.info("Testing configuration: %r", dict(base_config))
@@ -225,7 +225,7 @@ def test_new(self):
self.assertEqual(message.author, ["from@example.com"])
self.assertEqual(message.bcc, [])
self.assertEqual(message.retries, 2)
- self.assertIs(message.mailer, interface)
+ self.assertTrue(message.mailer is interface)
self.assertEqual(message.brand, False)
self.assertRaises(NotImplementedError, Message().send)
View
@@ -21,9 +21,9 @@ def closure(plugin):
try:
plug = plugin.load()
except ImportError as e:
- raise SkipTest("Skipped {} manager due to ImportError:\n{}".format(plugin.name, str(e)))
+ raise SkipTest("Skipped {name} manager due to ImportError:\n{err}".format(name=plugin.name, err=str(e)))
- ok_(isinstance(plug, IManager), "{} does not conform to the IManager API.".format(plugin.name))
+ ok_(isinstance(plug, IManager), "{name} does not conform to the IManager API.".format(name=plugin.name))
entrypoint = None
for entrypoint in pkg_resources.iter_entry_points('marrow.mailer.manager', None):
@@ -38,9 +38,9 @@ def closure(plugin):
try:
plug = plugin.load()
except ImportError as e:
- raise SkipTest("Skipped {} transport due to ImportError:\n{}".format(plugin.name, str(e)))
+ raise SkipTest("Skipped {name} transport due to ImportError:\n{err}".format(name=plugin.name, err=str(e)))
- ok_(isinstance(plug, ITransport), "{} does not conform to the ITransport API.".format(plugin.name))
+ ok_(isinstance(plug, ITransport), "{name} does not conform to the ITransport API.".format(name=plugin.name))
entrypoint = None
for entrypoint in pkg_resources.iter_entry_points('marrow.mailer.transport', None):
@@ -20,6 +20,7 @@
log = logging.getLogger('tests')
+
class TestMailDirectoryTransport(TestCase):
def setUp(self):
self.path = tempfile.mkdtemp()
@@ -38,7 +39,7 @@ def test_bad_config(self):
def test_startup(self):
self.transport.startup()
- self.assertIsInstance(self.transport.box, mailbox.Maildir)
+ self.assertTrue(isinstance(self.transport.box, mailbox.Maildir))
def test_child_folder_startup(self):
self.transport.folder = 'test'
@@ -48,7 +49,7 @@ def test_child_folder_startup(self):
def test_shutdown(self):
self.transport.startup()
self.transport.shutdown()
- self.assertIsNone(self.transport.box)
+ self.assertTrue(self.transport.box is None)
def test_delivery(self):
message = Message('from@example.com', 'to@example.com', "Test subject.")
@@ -36,12 +36,12 @@ def test_bad_config(self):
def test_startup(self):
self.transport.startup()
- self.assertIsInstance(self.transport.box, mailbox.mbox)
+ self.assertTrue(isinstance(self.transport.box, mailbox.mbox))
def test_shutdown(self):
self.transport.startup()
self.transport.shutdown()
- self.assertIsNone(self.transport.box)
+ self.assertTrue(self.transport.box is None)
def test_delivery(self):
message = Message('from@example.com', 'to@example.com', "Test subject.")

0 comments on commit 293f8f0

Please sign in to comment.