Skip to content

Commit d2a51bd

Browse files
Update testing docs to pytest and tox usage. (#224)
1 parent 9edd3e9 commit d2a51bd

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

docs/intro.rst

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,38 @@ Using it with distributed keys
3838
client.set('key', 'value')
3939
print(client.get('key'))
4040
41-
Running the tests
42-
-----------------
41+
Testing
42+
-------
4343

44-
First run memcached with:
44+
``python-binary-memcached`` unit tests are found in the ``test/`` directory
45+
and are designed to be run using `pytest`_. `pytest`_ will discover the tests
46+
automatically, so all you have to do is:
4547

46-
.. code-block:: bash
48+
.. code-block:: console
4749
48-
memcached -S -vvv
49-
memcached -p5000 -S -vvv
50-
memcached -S -s/tmp/memcached.sock -vvv
50+
$ pytest
51+
...
52+
170 passed in 4.43 seconds
5153
52-
This is to cover all tests with socket, standard port and non standard port.
54+
This runs the tests with the default Python interpreter.
5355

54-
Then, run the tests.
56+
You can also verify that the tests pass on other supported Python interpreters.
57+
For this we use `tox`_, which will automatically create a `virtualenv`_ for
58+
each supported Python version and run the tests. For example:
5559

56-
.. code-block:: bash
60+
.. code-block:: console
5761
58-
cd src_dir/
59-
py.test
62+
$ tox
63+
...
64+
py27: commands succeeded
65+
ERROR: py34: InterpreterNotFound: python3.4
66+
py35: commands succeeded
67+
py36: commands succeeded
68+
py37: commands succeeded
69+
py38: commands succeeded
70+
71+
You may not have all the required Python versions installed, in which case you
72+
will see one or more ``InterpreterNotFound`` errors.
6073

6174
Using with Django
6275
-----------------
@@ -66,3 +79,6 @@ Tests Status
6679
------------
6780
.. image:: https://travis-ci.org/jaysonsantos/python-binary-memcached.png?branch=master
6881
:target: https://travis-ci.org/jaysonsantos/python-binary-memcached
82+
83+
.. _`pytest`: https://pypi.org/project/pytest/
84+
.. _`tox`: https://pypi.org/project/tox/

0 commit comments

Comments
 (0)