From d0f7f5b0b1aa3feac7e0e06d1843b5660a9f7626 Mon Sep 17 00:00:00 2001 From: Ashima Athri Date: Wed, 19 Oct 2016 19:00:16 -0400 Subject: [PATCH 1/3] Ignore virtualenv env and tox files --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 65bebc8..0cfb772 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,8 @@ tmp* _build/ .cache *.swp +.tox +env example/idp3/htdocs/login.mako @@ -192,8 +194,6 @@ example/sp-repoze/old_sp.xml example/sp-repoze/sp_conf_2.Pygmalion -.gitignore.swp - example/sp-repoze/sp_conf_2.py sp.xml From a9800192a5ca0b14457fc32518dd21a505f7d155 Mon Sep 17 00:00:00 2001 From: Ashima Athri Date: Wed, 19 Oct 2016 19:01:26 -0400 Subject: [PATCH 2/3] Refactor test dependencies --- tests/test_requirements.txt | 3 ++- tox.ini | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_requirements.txt b/tests/test_requirements.txt index 537fccd..2c1ebbb 100644 --- a/tests/test_requirements.txt +++ b/tests/test_requirements.txt @@ -1,3 +1,4 @@ +mock==2.0.0 pymongo==3.0.1 +pytest==3.0.3 responses==0.5.0 -mock \ No newline at end of file diff --git a/tox.ini b/tox.ini index 327f4c1..d834512 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,5 @@ envlist = py27,py34 [testenv] -deps = pytest - -rtests/test_requirements.txt +deps = -rtests/test_requirements.txt commands = py.test tests/ From 4c4f2f4b096793e4b64cf3188413defe279bf482 Mon Sep 17 00:00:00 2001 From: Ashima Athri Date: Wed, 19 Oct 2016 19:01:43 -0400 Subject: [PATCH 3/3] Update readme with instructions for running tests locally --- README.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.rst b/README.rst index f6abb5d..205c925 100644 --- a/README.rst +++ b/README.rst @@ -26,3 +26,15 @@ necessary pieces for building a SAML2 service provider or an identity provider. The distribution contains examples of both. Originally written to work in a WSGI environment there are extensions that allow you to use it with other frameworks. + +Testing +======= +PySAML2 uses the `pytest `_ framework for +testing. To run the tests on your system's version of python + +1. Create and activate a `virtualenv `_. +2. Inside the virtualenv, install the dependencies needed for testing :code:`pip install -r tests/test_requirements.txt` +3. Run the tests :code:`py.test tests` + +To run tests in multiple python environments, you can use +`pyenv `_ with `tox `_.