summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2014-01-11 04:56:53 -0800
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2014-01-11 04:56:53 -0800
commit73f93130e3a49a81e500e80749ad61a2f78744cd (patch)
treead3aa046f9e25d45baf261639b9c143756abd0fc
parentdc513fa80322ae17f4e275e398ca331de14df8f2 (diff)
parent2b1e0bd1965f859783ac9cf2c5752b971900ecdd (diff)
downloadpyopenssl-73f93130e3a49a81e500e80749ad61a2f78744cd.tar.gz
Merge pull request #4 from pyca/tox
Add tox and travis-ci configuration to aid proper testing.
-rw-r--r--.travis.yml15
-rw-r--r--OpenSSL/crypto.py4
-rw-r--r--memdbg.py6
-rwxr-xr-xsetup.py6
-rw-r--r--tox.ini10
5 files changed, 34 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..659677a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,15 @@
+language: python
+
+os:
+ - linux
+ - osx
+
+python:
+ - "pypy"
+ - "2.6"
+ - "2.7"
+ - "3.2"
+ - "3.3"
+
+script:
+ - python setup.py test
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index 0c78b31..c2180d0 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -1926,10 +1926,10 @@ class _PassphraseHelper(object):
try:
_exception_from_error_queue(exceptionType)
except exceptionType as e:
- pass
+ from_queue = e
if self._problems:
raise self._problems[0]
- return e
+ return from_queue
def _read_passphrase(self, buf, size, rwflag, userdata):
diff --git a/memdbg.py b/memdbg.py
index e30b68c..324d0fd 100644
--- a/memdbg.py
+++ b/memdbg.py
@@ -31,7 +31,7 @@ verbose = False
def log(s):
if verbose:
- print s
+ print(s)
def _backtrace():
buf = _ffi.new("void*[]", 64)
@@ -75,8 +75,8 @@ def free(p):
if _api.CRYPTO_set_mem_functions(malloc, realloc, free):
- print 'Enabled memory debugging'
+ log('Enabled memory debugging')
heap = {}
else:
- print 'Failed to enable memory debugging'
+ log('Failed to enable memory debugging')
heap = None
diff --git a/setup.py b/setup.py
index c1bde55..ac53487 100755
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@
Installation script for the OpenSSL module
"""
-from distutils.core import setup
+from setuptools import setup
# XXX Deduplicate this
__version__ = '0.13'
@@ -34,6 +34,7 @@ setup(name='pyOpenSSL', version=__version__,
maintainer_email = 'exarkun@twistedmatrix.com',
url = 'https://github.com/pyca/pyopenssl',
license = 'APL2',
+ install_requires=["cryptography>=0.1"],
long_description = """\
High-level wrapper around a subset of the OpenSSL library, includes
* SSL.Connection objects, wrapping the methods of Python's portable
@@ -58,4 +59,5 @@ High-level wrapper around a subset of the OpenSSL library, includes
'Topic :: Security :: Cryptography',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking',
- ])
+ ],
+ test_suite="OpenSSL.test")
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..67386d1
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,10 @@
+[tox]
+envlist = pypy,py26,py27,py32,py33
+
+[testenv]
+setenv =
+ # Do not allowed the executing environment to pollute the test environment
+ # with extra packages.
+ PYTHONPATH=
+# The standard library unittest module can run tests on Python 2.7 and newer
+commands = python setup.py test