diff options
| author | Sergey Shepelev <temotor@gmail.com> | 2013-10-07 16:48:34 +0400 |
|---|---|---|
| committer | Sergey Shepelev <temotor@gmail.com> | 2013-12-03 22:36:29 +0400 |
| commit | d2bbbd79d3f903fbff59f09467af681d5b9282cf (patch) | |
| tree | 6a6da9b62894d62fdaa1050acbd39c46e710b9e8 /doc/testing.rst | |
| parent | 35f600600c59c295fab0131c7bc0032e28b70045 (diff) | |
| download | eventlet-d2bbbd79d3f903fbff59f09467af681d5b9282cf.tar.gz | |
python3 compat: remove lots of Python 2.5 and earlier dependent code; use print() function syntax
Diffstat (limited to 'doc/testing.rst')
| -rw-r--r-- | doc/testing.rst | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/doc/testing.rst b/doc/testing.rst index d63d8d2..1e7a887 100644 --- a/doc/testing.rst +++ b/doc/testing.rst @@ -6,7 +6,7 @@ Eventlet is tested using `Nose <http://somethingaboutorange.com/mrl/projects/nos .. code-block:: sh $ python setup.py test - + If you want access to all the nose plugins via command line, you can run: .. code-block:: sh @@ -23,8 +23,6 @@ That's it! The output from running nose is the same as unittest's output, if th Many tests are skipped based on environmental factors; for example, it makes no sense to test Twisted-specific functionality when Twisted is not installed. These are printed as S's during execution, and in the summary printed after the tests run it will tell you how many were skipped. -.. note:: If running Python version 2.4, use this command instead: ``python tests/nosewrapper.py``. There are several tests which make use of the `with` statement and therefore will cause nose grief when it tries to import them; nosewrapper.py excludes these tests so they are skipped. - Doctests -------- @@ -33,7 +31,7 @@ To run the doctests included in many of the eventlet modules, use this command: .. code-block :: sh $ nosetests --with-doctest eventlet/*.py - + Currently there are 16 doctests. Standard Library Tests @@ -46,7 +44,7 @@ There's a convenience module called all.py designed to handle the impedance mism .. code-block:: sh $ nosetests tests/stdlib/all.py - + That will run all the tests, though the output will be a little weird because it will look like Nose is running about 20 tests, each of which consists of a bunch of sub-tests. Not all test modules are present in all versions of Python, so there will be an occasional printout of "Not importing %s, it doesn't exist in this installation/version of Python". If you see "Ran 0 tests in 0.001s", it means that your Python installation lacks its own tests. This is usually the case for Linux distributions. One way to get the missing tests is to download a source tarball (of the same version you have installed on your system!) and copy its Lib/test directory into the correct place on your PYTHONPATH. @@ -75,7 +73,7 @@ If you are writing a test that involves a client connecting to a spawned server, server_sock = eventlet.listener(('127.0.0.1', 0)) client_sock = eventlet.connect(('localhost', server_sock.getsockname()[1])) - + Coverage -------- @@ -84,7 +82,7 @@ Coverage.py is an awesome tool for evaluating how much code was exercised by uni .. code-block:: sh nosetests --with-coverage --cover-package=eventlet - + After running the tests to completion, this will emit a huge wodge of module names and line numbers. For some reason, the ``--cover-inclusive`` option breaks everything rather than serving its purpose of limiting the coverage to the local files, so don't use that. The html option is quite useful because it generates nicely-formatted HTML that are much easier to read than line-number soup. Here's a command that generates the annotation, dumping the html files into a directory called "cover": @@ -92,5 +90,5 @@ The html option is quite useful because it generates nicely-formatted HTML that .. code-block:: sh coverage html -d cover --omit='tempmod,<console>,tests' - + (``tempmod`` and ``console`` are omitted because they gets thrown away at the completion of their unit tests and coverage.py isn't smart enough to detect this.) |
