From c987ac88c7aebad0b4a48e9bfd91f5e1f5a465e0 Mon Sep 17 00:00:00 2001 From: Rebecka Gulliksson Date: Thu, 12 Nov 2015 10:47:34 +0100 Subject: [PATCH 1/4] Don't write subject data to db in tests. --- tests/idp_conf_sp_no_encrypt.py | 1 - tests/idp_conf_verify_cert.py | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/idp_conf_sp_no_encrypt.py b/tests/idp_conf_sp_no_encrypt.py index 6e1a9ef..c9b5ad0 100644 --- a/tests/idp_conf_sp_no_encrypt.py +++ b/tests/idp_conf_sp_no_encrypt.py @@ -36,7 +36,6 @@ CONFIG = { # } } }, - "subject_data": full_path("subject_data_3.db"), #"domain": "umu.se", #"name_qualifier": "" }, diff --git a/tests/idp_conf_verify_cert.py b/tests/idp_conf_verify_cert.py index 1318352..9333d62 100644 --- a/tests/idp_conf_verify_cert.py +++ b/tests/idp_conf_verify_cert.py @@ -45,7 +45,6 @@ CONFIG = { # } } }, - "subject_data": full_path("subject_data_2.db"), #"domain": "umu.se", #"name_qualifier": "" }, From 1eb06f7374cc55c1fd99d6349f72be0644b30b02 Mon Sep 17 00:00:00 2001 From: Rebecka Gulliksson Date: Thu, 12 Nov 2015 10:54:53 +0100 Subject: [PATCH 2/4] Update tox.ini to actually run tests and make Travis use it. Remove py.test runner from setup.py. --- .travis.yml | 9 ++++++--- setup.py | 17 ----------------- tox.ini | 8 ++------ 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9a7d9ea..b9fdd09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ language: python sudo: false env: - - TOX_ENV=py27 - - TOX_ENV=py34 + - TOXENV=py27 + - TOXENV=py34 addons: apt: @@ -14,5 +14,8 @@ addons: services: - mongodb +install: + - pip install -U tox + script: - - ./setup.py test + - tox diff --git a/setup.py b/setup.py index 682daa2..d2a57c2 100755 --- a/setup.py +++ b/setup.py @@ -6,21 +6,6 @@ import sys from setuptools import setup from setuptools.command.test import test as TestCommand - -class PyTest(TestCommand): - - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = [] - self.test_suite = True - - def run_tests(self): - #import here, cause outside the eggs aren't loaded - import pytest - errno = pytest.main(self.test_args) - sys.exit(errno) - - install_requires = [ # core dependencies 'decorator', @@ -85,6 +70,4 @@ setup( }, install_requires=install_requires, zip_safe=False, - test_suite='tests', - cmdclass={'test': PyTest}, ) diff --git a/tox.ini b/tox.ini index 880383b..7195b10 100644 --- a/tox.ini +++ b/tox.ini @@ -2,9 +2,5 @@ envlist = py27,py34 [testenv] -basepython = - py27: python2.7 - py34: python3.4 - -deps = - pytest +deps = pytest +commands = py.test tests/ From 294e1ab7004112530640326b3682aa3721672a7e Mon Sep 17 00:00:00 2001 From: Rebecka Gulliksson Date: Thu, 12 Nov 2015 13:12:34 +0100 Subject: [PATCH 3/4] Add pymongo as test requirement in tox. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 7195b10..02c1a6a 100644 --- a/tox.ini +++ b/tox.ini @@ -3,4 +3,5 @@ envlist = py27,py34 [testenv] deps = pytest + pymongo==3.0.1 commands = py.test tests/ From 9026a4a737d3f1e1cba293703412d43a18a27c7c Mon Sep 17 00:00:00 2001 From: Rebecka Gulliksson Date: Thu, 12 Nov 2015 13:17:54 +0100 Subject: [PATCH 4/4] Remove test dependencies from setup.py. --- setup.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/setup.py b/setup.py index d2a57c2..7315457 100755 --- a/setup.py +++ b/setup.py @@ -20,17 +20,6 @@ install_requires = [ 'six' ] -tests_require = [ - 'mongodict', - 'pyasn1', - 'pymongo==3.0.1', - 'python-memcached >= 1.51', - 'pytest', - 'mako', - 'webob', - #'pytest-coverage', -] - version = '' with open('src/saml2/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', @@ -63,11 +52,6 @@ setup( scripts=["tools/parse_xsd2.py", "tools/make_metadata.py", "tools/mdexport.py", "tools/merge_metadata.py"], - - tests_require=tests_require, - extras_require={ - 'testing': tests_require, - }, install_requires=install_requires, zip_safe=False, )