Skip to content

Commit 50d576c

Browse files
committed
Merge pull request #151 from tony/pytest
Switch to py.test
2 parents c2a7200 + 2fab3a0 commit 50d576c

File tree

94 files changed

+4241
-5206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4241
-5206
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
omit =
3-
*/testsuite/*
3+
test/*
44
*/_vendor/*
55
*/_*
66
pkg/*

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
*.pyc
22
*.pyo
3-
.venv
4-
.venv3
3+
*env*/
4+
.cache/
5+
.eggs/
56
dist
67
*.egg
78
*.egg-info

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ env:
1616
- TMUX_VERSION=1.9a
1717
before_install:
1818
- export PIP_USE_MIRRORS=true
19+
- pip install --upgrade pytest # https://github.com/travis-ci/travis-ci/issues/4873
20+
- pip install --upgrade pip wheel virtualenv setuptools
1921
- pip install coveralls
2022
install:
2123
- pip install -e .

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
include README.rst LICENSE CHANGES run-tests.py .tmuxp.yaml
1+
include README.rst LICENSE CHANGES .tmuxp.yaml
22
include requirements.pip package_metadata.py
33
recursive-include doc *.rst

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test:
2-
./run-tests.py
2+
py.test
33

44
watch_test:
55
if command -v entr > /dev/null; then find . -type f -not -path '*/\.*' | grep -i '.*[.]py' | entr -c make test; else make test; echo "\nInstall entr(1) to automatically run tests on file change.\n See http://entrproject.org/"; fi
@@ -17,7 +17,7 @@ watch_docs:
1717
cd doc && $(MAKE) watch_docs
1818

1919
flake8:
20-
flake8 tmuxp
20+
flake8 tmuxp tests
2121

2222
watch_flake8:
2323
if command -v entr > /dev/null; then find . -type f -not -path '*/\.*' | grep -i '.*[.][py]' | entr -c make flake8; else make flake8; echo "\nInstall entr(1) to automatically run tests on file change.\n See http://entrproject.org/"; fi

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ install dev .. code-block:: bash
105105
more.
106106
tests .. code-block:: bash
107107

108-
$ python ./run-tests.py
108+
$ make test
109109
============== ==========================================================
110110

111111
.. _BSD: http://opensource.org/licenses/BSD-3-Clause

doc/about.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ More details
105105

106106
.. _attempt at 1.7 test: https://travis-ci.org/tony/tmuxp/jobs/12348263
107107
.. _kaptan: https://github.com/emre/kaptan
108-
.. _unittest: http://docs.python.org/2/library/unittest.html
109108
.. _BSD-licensed: http://opensource.org/licenses/BSD-2-Clause
110109
.. _tmuxinator: https://github.com/aziz/tmuxinator
111110
.. _teamocil: https://github.com/remiprev/teamocil

doc/developing.rst

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ Developing and Testing
99
.. todo::
1010
link to sliderepl or ipython notebook slides
1111

12-
Our tests are inside ``./tmuxp/testsuite``. Tests are implemented using
13-
:py:mod:`unittest`.
12+
Our tests are inside ``tests/``. Tests are implemented using
13+
`pytest`_.
1414

15-
``./run-tests.py`` will create a tmux server on a separate ``socket_name``
15+
``make test`` will create a tmux server on a separate ``socket_name``
1616
using ``$ tmux -L test_case``.
1717

18+
.. _pytest: http://pytest.org/
19+
1820
.. _install_dev_env:
1921

2022
Install the latest code from git
@@ -64,7 +66,7 @@ folder with its own packages.
6466

6567
.. code-block:: bash
6668
67-
$ ./run-tests.py
69+
$ make test
6870
6971
You probably didn't see anything but tests scroll by.
7072

@@ -76,35 +78,32 @@ If you found a problem or are trying to write a test, you can file an
7678
Test runner options
7779
~~~~~~~~~~~~~~~~~~~
7880

79-
.. note::
80-
81-
As of v0.1.1, the old way of using ``--tests`` is now deprecated.
82-
8381
Testing specific TestSuites and TestCase.
8482

8583
.. code-block:: bash
8684
87-
$ ./run-tests.py config
85+
$ py.test tests/test_config.py
8886
89-
will test the ``testsuite.config`` :py:class:`unittest.TestSuite`.
87+
will test the ``tests/test_config.py`` tests.
9088

9189
.. code-block:: bash
9290
93-
$ ./run-tests.py config.ImportExportTest
91+
$ py.test tests/test_config::ImportExportTest
9492
95-
tests ``testsuite.config.ImportExportTest`` :py:class:`unittest.TestCase`.
93+
tests ``ImportExportTest`` :py:class:`unittest.TestCase` inside of
94+
``tests/test_config.py``.
9695

9796
individual tests:
9897

9998
.. code-block:: bash
10099
101-
$ ./run-tests.py config.ImportExportTest.test_export_json
100+
$ py.test tests/test_config::ImportExportTest::test_export_Json
102101
103102
Multiple can be separated by spaces:
104103

105104
.. code-block:: bash
106105
107-
$ ./run-tests.py window pane config.ImportExportTest
106+
$ py.test tests/test_{window,pane}.py tests/test_config.py::ImportExportTest::test_export_json
108107
109108
.. _test_builder_visually:
110109

@@ -123,7 +122,7 @@ Create two terminals:
123122

124123
.. code-block:: bash
125124
126-
$ python ./run-tests.py --tests tests_workspacebuilder
125+
$ py.test tests/test_workspacebuilder.py
127126
128127
Terminal 1 should have flickered and built the session before your eyes.
129128
tmuxp hides this building from normal users.
@@ -143,7 +142,7 @@ To run all tests upon editing any ``.py`` file:
143142

144143
.. code-block:: bash
145144
146-
$ find . -type f -not -path '*/\.*' | grep -i '.*[.]py$' | entr -c ./run-tests.py
145+
$ make watch_test
147146
148147
.. _entr: http://entrproject.org/
149148

@@ -152,7 +151,7 @@ Rebuild the documentation when an ``.rst`` file is edited:
152151
.. code-block:: bash
153152
154153
$ cd doc
155-
$ find .. -print | grep -i '.*[.]rst' | entr -c make html
154+
$ make watch
156155
157156
.. _tmuxp developer config:
158157

requirements/test.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
flaky==3.1.1
2+
pytest==2.9.1

run-tests.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)