Skip to content

Commit bd60025

Browse files
authored
Merge pull request #68 from all3fox/config-tox
Use `tox` to run unit-tests
2 parents 0906afa + b4eb81c commit bd60025

7 files changed

+57
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.pyc
22
/boolean.py.egg-info/
33
/build/
4+
/.tox/
45
/dist/
56
/tmp/
67
/.cache/

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ python:
66
- "2.7"
77
- "3.4"
88
- "3.5"
9+
- "3.6"
910

1011
install:
1112
- pip install --upgrade pip

README.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,30 @@ Documentation
3838

3939
http://readthedocs.org/docs/booleanpy/en/latest/
4040

41+
Installation
42+
------------
4143

44+
`pip install boolean.py`
4245

43-
Download and installation
44-
-------------------------
46+
Testing
47+
-------
48+
49+
Test `boolean.py` with your current Python environment:
50+
51+
`python setup.py test`
4552

46-
`pip install boolean.py`
53+
Test with all of the supported Python environments using `tox`:
4754

55+
```
56+
pip install -r test-requirements.txt
57+
tox
58+
```
59+
60+
If `tox` throws `InterpreterNotFound`, limit it to python interpreters that are actually installed on your machine:
61+
62+
```
63+
tox -e py27,py36
64+
```
4865

4966
License
5067
-------

docs/development_guide.rst

+22
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,28 @@ and laws are stated in :doc:`concepts`.
1010
:depth: 2
1111
:backlinks: top
1212

13+
Testing
14+
-------
15+
16+
Test `boolean.py` with your current Python environment:
17+
18+
.. code-block:: shell
19+
20+
python setup.py test
21+
22+
Test with all of the supported Python environments using `tox`:
23+
24+
.. code-block:: shell
25+
26+
pip install -r test-requirements.txt
27+
tox
28+
29+
If `tox` throws `InterpreterNotFound`, limit it to python interpreters that are actually installed on your machine:
30+
31+
.. code-block:: shell
32+
33+
tox -e py27,py36
34+
1335
Classes Hierarchy
1436
-----------------
1537
..

docs/users_guide.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ Other compositions like XOR and NAND are not implemented.
2525

2626
Installation
2727
------------
28-
::
29-
pip install boolean.py
3028

29+
.. code-block:: sh
30+
31+
pip install boolean.py
3132
3233
Creating boolean expressions
3334
----------------------------
@@ -39,7 +40,7 @@ an algebra, then use algebra attributes and methods to build expressions.
3940
You can build an expression from a string:
4041

4142
.. doctest:: boolean
42-
43+
4344
>>> import boolean
4445
>>> algebra = boolean.BooleanAlgebra()
4546
>>> algebra.parse('x & y')
@@ -59,7 +60,7 @@ You can build an expression from a Python expression:
5960
>>> x & y
6061
AND(Symbol('x'), Symbol('y'))
6162

62-
You can build an expression by using the algebra functions::
63+
You can build an expression by using the algebra functions:
6364

6465
.. doctest:: boolean
6566

@@ -254,9 +255,9 @@ Using boolean.py to define your own boolean algebra
254255
---------------------------------------------------
255256

256257
You can customize about everything in boolean.py to create your own custom algebra:
257-
1. You can subclass :class:`BooleanAlgebra` and override or extend the
258-
:meth:`tokenize`:: and :meth:`parse`:: method to parse custom expression creating
259-
your own mini expression language. Seen the tests for examples.
258+
1. You can subclass :class:`BooleanAlgebra` and override or extend the
259+
:meth:`tokenize` and :meth:`parse` methods to parse custom expressions creating
260+
your own mini expression language. See the tests for examples.
260261

261262
2. You can subclass the Symbol, NOT, AND and OR functions to add additional
262263
methods or for custom representations.

test-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tox=2.7.0

tox.ini

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[tox]
2+
envlist=py27,py36
3+
[testenv]
4+
commands=python setup.py test

0 commit comments

Comments
 (0)