@@ -38,25 +38,38 @@ Using it with distributed keys
38
38
client.set(' key' , ' value' )
39
39
print (client.get(' key' ))
40
40
41
- Running the tests
42
- -----------------
41
+ Testing
42
+ -------
43
43
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:
45
47
46
- .. code-block :: bash
48
+ .. code-block :: console
47
49
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
51
53
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 .
53
55
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:
55
59
56
- .. code-block :: bash
60
+ .. code-block :: console
57
61
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.
60
73
61
74
Using with Django
62
75
-----------------
@@ -66,3 +79,6 @@ Tests Status
66
79
------------
67
80
.. image :: https://travis-ci.org/jaysonsantos/python-binary-memcached.png?branch=master
68
81
: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