diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-12 17:52:49 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-12 17:52:49 -0500 |
commit | b345eaa1d3d572c1a4dc388f0581b649857a5252 (patch) | |
tree | b3e8641c433e36b7544858696fc560d0f15e20d7 /doc/contributing.rst | |
parent | 2a7b18184d41b1e172bf3366db812b89e8b82332 (diff) | |
download | python-coveragepy-b345eaa1d3d572c1a4dc388f0581b649857a5252.tar.gz |
Try to format the contributing page better.
Diffstat (limited to 'doc/contributing.rst')
-rw-r--r-- | doc/contributing.rst | 142 |
1 files changed, 66 insertions, 76 deletions
diff --git a/doc/contributing.rst b/doc/contributing.rst index 273d06d..d0967f8 100644 --- a/doc/contributing.rst +++ b/doc/contributing.rst @@ -6,6 +6,8 @@ Contributing to coverage.py :history: 20121112T154100, brand new docs. +.. highlight:: console + I welcome contributions to coverage.py. Over the years, dozens of people have provided patches of various sizes to add features or fix bugs. This page should have all the information you need to make a contribution. @@ -37,15 +39,11 @@ these steps: #. (Optional, but recommended) Create a virtualenv to work in, and activate it. -#. Clone the repo: - - .. code-block:: console +#. Clone the repo:: $ hg clone https://bitbucket.org/ned/coveragepy -#. Install the requirements: - - .. code-block:: console +#. Install the requirements:: $ pip install -r requirements.txt @@ -59,69 +57,63 @@ Running the tests ----------------- The tests are written as standard unittest-style tests, and are run with -`tox`_: - - .. code-block:: console - - $ tox - GLOB sdist-make: /home/ned/coverage/setup.py - py25 sdist-reinst: /home/ned/coverage/tox/dist/coverage-3.5.4b1.zip - py25 runtests: commands[0] - py25 runtests: commands[1] - py25 runtests: commands[2] - py25 runtests: commands[3] - py25 runtests: commands[4] - === Python 2.5.5 with Python tracer (/home/ned/coverage/tox/py25/bin/python) === - ...........................................................................................(etc) - ---------------------------------------------------------------------- - Ran 360 tests in 10.836s - - OK - py25 runtests: commands[5] - py25 runtests: commands[6] - === Python 2.5.5 with C tracer (/home/ned/coverage/tox/py25/bin/python) === - ...........................................................................................(etc) - ---------------------------------------------------------------------- - Ran 360 tests in 10.044s - - OK - py26 sdist-reinst: /home/ned/coverage/trunk/.tox/dist/coverage-3.5.4b1.zip - py26 runtests: commands[0] - py26 runtests: commands[1] - py26 runtests: commands[2] - py26 runtests: commands[3] - py26 runtests: commands[4] - === CPython 2.6.6 with Python tracer (/home/ned/coverage/tox/py26/bin/python) === - ...........................................................................................(etc) - ---------------------------------------------------------------------- - Ran 364 tests in 12.572s - - OK - py26 runtests: commands[5] - py26 runtests: commands[6] - === CPython 2.6.6 with C tracer (/home/ned/coverage/tox/py26/bin/python) === - ...........................................................................................(etc) - ---------------------------------------------------------------------- - Ran 364 tests in 11.458s - - OK - (and so on...) +`tox`_:: + + $ tox + GLOB sdist-make: /home/ned/coverage/setup.py + py25 sdist-reinst: /home/ned/coverage/tox/dist/coverage-3.5.4b1.zip + py25 runtests: commands[0] + py25 runtests: commands[1] + py25 runtests: commands[2] + py25 runtests: commands[3] + py25 runtests: commands[4] + === Python 2.5.5 with Python tracer (/home/ned/coverage/tox/py25/bin/python) === + ...........................................................................................(etc) + ---------------------------------------------------------------------- + Ran 360 tests in 10.836s + + OK + py25 runtests: commands[5] + py25 runtests: commands[6] + === Python 2.5.5 with C tracer (/home/ned/coverage/tox/py25/bin/python) === + ...........................................................................................(etc) + ---------------------------------------------------------------------- + Ran 360 tests in 10.044s + + OK + py26 sdist-reinst: /home/ned/coverage/trunk/.tox/dist/coverage-3.5.4b1.zip + py26 runtests: commands[0] + py26 runtests: commands[1] + py26 runtests: commands[2] + py26 runtests: commands[3] + py26 runtests: commands[4] + === CPython 2.6.6 with Python tracer (/home/ned/coverage/tox/py26/bin/python) === + ...........................................................................................(etc) + ---------------------------------------------------------------------- + Ran 364 tests in 12.572s + + OK + py26 runtests: commands[5] + py26 runtests: commands[6] + === CPython 2.6.6 with C tracer (/home/ned/coverage/tox/py26/bin/python) === + ...........................................................................................(etc) + ---------------------------------------------------------------------- + Ran 364 tests in 11.458s + + OK + (and so on...) Tox runs the complete test suite twice for each version of Python you have installed. The first run uses the Python implementation of the trace function, the second uses the C implementation. -To limit tox to just a few versions of Python, use the ``-e`` switch: - - .. code-block:: console - - $ tox -e py27,py33 +To limit tox to just a few versions of Python, use the ``-e`` switch:: -To run just a few tests, you can use nose test selector syntax: + $ tox -e py27,py33 - .. code-block:: console +To run just a few tests, you can use nose test selector syntax:: - $ tox test.test_misc:SetupPyTest.test_metadata + $ tox test.test_misc:SetupPyTest.test_metadata This looks in `test/test_misc.py` to find the `SetupPyTest` class, and runs the `test_metadata` test method. @@ -134,21 +126,19 @@ Lint, etc --------- I try to keep the coverage.py as clean as possible. I use pylint to alert me -to possible problems: - - .. code-block:: console - - $ make lint - pylint --rcfile=.pylintrc coverage setup.py test - ************* Module coverage.collector - F0401: 7,4: Unable to import 'coverage.tracer' - E0611: 7,4: No name 'tracer' in module 'coverage' - ************* Module coverage.parser - W0631:532,32:ByteParser._split_into_chunks: Using possibly undefined loop variable 'bc' - W0631:579,40:ByteParser._arcs: Using possibly undefined loop variable 'ch' - make: [lint] Error 7 (ignored) - python -m tabnanny coverage setup.py test - python igor.py check_eol +to possible problems:: + + $ make lint + pylint --rcfile=.pylintrc coverage setup.py test + ************* Module coverage.collector + F0401: 7,4: Unable to import 'coverage.tracer' + E0611: 7,4: No name 'tracer' in module 'coverage' + ************* Module coverage.parser + W0631:532,32:ByteParser._split_into_chunks: Using possibly undefined loop variable 'bc' + W0631:579,40:ByteParser._arcs: Using possibly undefined loop variable 'ch' + make: [lint] Error 7 (ignored) + python -m tabnanny coverage setup.py test + python igor.py check_eol As you can see, a few warnings persist, don't worry about them. But clean up any ones you may be responsible for. |