Skip to content

Commit

Permalink
Merge pull request pyca#4 from pyca/tox
Browse files Browse the repository at this point in the history
Add tox and travis-ci configuration to aid proper testing.
  • Loading branch information
exarkun committed Jan 11, 2014
2 parents dc513fa + 2b1e0bd commit 73f9313
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: python

os:
- linux
- osx

python:
- "pypy"
- "2.6"
- "2.7"
- "3.2"
- "3.3"

script:
- python setup.py test
4 changes: 2 additions & 2 deletions OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1926,10 +1926,10 @@ def raise_if_problem(self, exceptionType=Error):
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):
Expand Down
6 changes: 3 additions & 3 deletions memdbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

def log(s):
if verbose:
print s
print(s)

def _backtrace():
buf = _ffi.new("void*[]", 64)
Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -34,6 +34,7 @@
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
Expand All @@ -58,4 +59,5 @@
'Topic :: Security :: Cryptography',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking',
])
],
test_suite="OpenSSL.test")
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 73f9313

Please sign in to comment.