From 5c106f2d1585ee91fd9b6370fee2faceeba8f264 Mon Sep 17 00:00:00 2001 From: Rich Leland Date: Sun, 12 Feb 2012 22:55:03 -0500 Subject: [PATCH 1/5] Ignore coverage and tox dirs --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index f3db2c7..2cb7790 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *.nja *.pyc +.coverage +.tox _build build dist From 43fc7e795afe7f677de8f6260ef4645bad86145a Mon Sep 17 00:00:00 2001 From: Rich Leland Date: Sun, 12 Feb 2012 22:56:34 -0500 Subject: [PATCH 2/5] Added basics to begin multi-mech testing --- multimechanize/test/coveragerc | 2 ++ multimechanize/test/test_multimech.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 multimechanize/test/coveragerc create mode 100644 multimechanize/test/test_multimech.py diff --git a/multimechanize/test/coveragerc b/multimechanize/test/coveragerc new file mode 100644 index 0000000..4de9469 --- /dev/null +++ b/multimechanize/test/coveragerc @@ -0,0 +1,2 @@ +[run] +omit = multimechanize/test/* diff --git a/multimechanize/test/test_multimech.py b/multimechanize/test/test_multimech.py new file mode 100644 index 0000000..5e1d481 --- /dev/null +++ b/multimechanize/test/test_multimech.py @@ -0,0 +1,14 @@ +import unittest + + +def test_something(): + assert (1 == 3) + + +class TestMultiMech(unittest.TestCase): + def setUp(self): + pass + + def tearDown(self): + pass + From 409fec0114fcedf034f56293bd0ee6b6bddbab82 Mon Sep 17 00:00:00 2001 From: Rich Leland Date: Sun, 12 Feb 2012 23:09:00 -0500 Subject: [PATCH 3/5] Added tox config --- tox.ini | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tox.ini diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..7d8159a --- /dev/null +++ b/tox.ini @@ -0,0 +1,12 @@ +[tox] +envlist = py27 + +[testenv] +changedir = multimechanize/test +;setenv = PYTHONPATH = {toxinidir}/tests +commands = py.test --basetemp={envtmpdir} --cov-config {toxinidir}/multimechanize/test/coveragerc --cov multimechanize + +[testenv:py27] +deps = + pytest + pytest-cov From 8c8e52c44a6c424c982e1b75df5bdbd1bbd9fadf Mon Sep 17 00:00:00 2001 From: Rich Leland Date: Sun, 12 Feb 2012 23:28:31 -0500 Subject: [PATCH 4/5] Added note about test running to the docs --- docs/dev.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/dev.rst b/docs/dev.rst index c8cc617..75fad3d 100644 --- a/docs/dev.rst +++ b/docs/dev.rst @@ -22,6 +22,19 @@ Multi-Mechanize development is hosted at GitHub and uses * IRC: `Freenode `_ ``#multimech`` channel * Mailing List: `Google Group `_ +*********** + Testing +*********** + +The Multi-Mechanize tests use `tox`_, `py.test`_ and `coverage`_. To run the tests, run the following from your clone's root directory:: + + pip install tox + tox + +.. _tox: http://tox.readthedocs.org/ +.. _py.test: http://pytest.org/ +.. _coverage: http://nedbatchelder.com/code/coverage/ + ********** Issues ********** From 0dc1d8d6ec22fcc13c9a8696dca35a8b5c864614 Mon Sep 17 00:00:00 2001 From: Rich Leland Date: Sun, 12 Feb 2012 23:33:16 -0500 Subject: [PATCH 5/5] Make the dummy test pass and import multimechanize --- multimechanize/test/test_multimech.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multimechanize/test/test_multimech.py b/multimechanize/test/test_multimech.py index 5e1d481..3127162 100644 --- a/multimechanize/test/test_multimech.py +++ b/multimechanize/test/test_multimech.py @@ -1,8 +1,10 @@ import unittest +import multimechanize + def test_something(): - assert (1 == 3) + assert (1 == 1) class TestMultiMech(unittest.TestCase):