Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to py.test #151

Merged
merged 47 commits into from
May 22, 2016
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4a587df
Ignore all types of virtualenv dir
tony May 21, 2016
ace8043
Refactor tests structure for py.test, optimize helper imports
tony May 21, 2016
553ac81
Ignore .cache/ and .eggs/
tony May 21, 2016
dfa1cb1
switch window rename to use sh shell as test
tony May 21, 2016
8c18356
Add flaky for rerunning those tricky testcases
tony May 21, 2016
bd6616a
reorder test deps
tony May 21, 2016
82ed172
Update pip, wheel, virtualenv before install on travis
tony May 21, 2016
79b981b
Try upgrading setuptools
tony May 21, 2016
06779a1
Upgrade pytest
tony May 21, 2016
20b3fd1
try upgrading setuptools/pip once more
tony May 21, 2016
9bfd122
Omit tests/ dir from coveragerc
tony May 21, 2016
8f380b6
remove run-tests.py
tony May 21, 2016
a06bc09
Update make test command to py.test
tony May 21, 2016
2c467b3
Clean up old TestLoader infrastructure
tony May 21, 2016
03df8df
flake8 for tests also
tony May 21, 2016
bd7e8f9
Refactor tests for py.test fixture, polish
tony May 21, 2016
d416a53
Update docs for new test directions
tony May 21, 2016
bebbd88
Update README/dox/MANIFEST.in to rm run-tests.py and use make test
tony May 21, 2016
120106c
switch to py.test style asserts, cleanup param order
tony May 21, 2016
713a5e8
port cli tests to py.test functions
tony May 21, 2016
43b4973
midway commit of py.test function rewrite test_config
tony May 22, 2016
e5abc75
Move second expansion test to yaml files+fixtures
tony May 22, 2016
2823379
add util to load fixtures, more tests to fixtures, py.test functions
tony May 22, 2016
41e89ed
move sample config to fixture
tony May 22, 2016
9314c5c
helper function to make loading configs brief
tony May 22, 2016
d9b1de0
Finish test_config py.test fixturization/function conversion
tony May 22, 2016
fcd54c3
Briefen fixture name
tony May 22, 2016
8cbeac7
Move load fixtures to tests/fixtures root
tony May 22, 2016
3141d81
teamocil config tests to fixtures
tony May 22, 2016
e788ab5
Move rest of tmuxinator configs to fixtures
tony May 22, 2016
9f8adcb
move tests for test helpers to tests/tests/
tony May 22, 2016
4316aa0
convert window test to functional, add server/session test fixtures
tony May 22, 2016
10b8eb8
parametrize multisession teamocil import test
tony May 22, 2016
795df2e
Move rest of teamocil config tests to py.test
tony May 22, 2016
781129b
tmuxinator tests to py.test parametrized funcs
tony May 22, 2016
faa771a
Rename t decorator to server, test_server to py.test funcs
tony May 22, 2016
66a9493
move test_session to py.test funcs
tony May 22, 2016
b9eb738
port test_tmuxobject to py.test
tony May 22, 2016
f877bae
workspace{builder,freeze} split fixtures, tweak flaky
tony May 22, 2016
7df1b3c
move more tests (util, workspacebuilder) to py.test func
tony May 22, 2016
8225be1
convert rest tests to py.test
tony May 22, 2016
e7b0591
Clean out unused test helpers, fixture usage fixes
tony May 22, 2016
310ebcc
remove unittest2 dep
tony May 22, 2016
586456b
Fix indentation in setup.py
tony May 22, 2016
447f917
fixes to test decorators, run in function scope for now
tony May 22, 2016
91ccb36
rm unittest2 dep from tox
tony May 22, 2016
2fab3a0
Update doc for pytest
tony May 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docs for new test directions
  • Loading branch information
tony committed May 21, 2016
commit d416a53b3f52f0de0011e225be80dea229435254
33 changes: 16 additions & 17 deletions doc/developing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ Developing and Testing
.. todo::
link to sliderepl or ipython notebook slides

Our tests are inside ``./tmuxp/testsuite``. Tests are implemented using
:py:mod:`unittest`.
Our tests are inside ``tests/``. Tests are implemented using
:py:mod:`unittest` and are being converted to `pytest`_.

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

.. _pytest: http://pytest.org/

.. _install_dev_env:

Install the latest code from git
Expand Down Expand Up @@ -64,7 +66,7 @@ folder with its own packages.

.. code-block:: bash

$ ./run-tests.py
$ make test

You probably didn't see anything but tests scroll by.

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

.. note::

As of v0.1.1, the old way of using ``--tests`` is now deprecated.

Testing specific TestSuites and TestCase.

.. code-block:: bash

$ ./run-tests.py config
$ py.test tests/test_config.py

will test the ``testsuite.config`` :py:class:`unittest.TestSuite`.
will test the ``tests/test_config.py`` tests.

.. code-block:: bash

$ ./run-tests.py config.ImportExportTest
$ py.test tests/test_config::ImportExportTest

tests ``testsuite.config.ImportExportTest`` :py:class:`unittest.TestCase`.
tests ``ImportExportTest`` :py:class:`unittest.TestCase` inside of
``tests/test_config.py``.

individual tests:

.. code-block:: bash

$ ./run-tests.py config.ImportExportTest.test_export_json
$ py.test tests/test_config::ImportExportTest::test_export_Json

Multiple can be separated by spaces:

.. code-block:: bash

$ ./run-tests.py window pane config.ImportExportTest
$ py.test tests/test_{window,pane}.py tests/test_config.py::ImportExportTest::test_export_json

.. _test_builder_visually:

Expand All @@ -123,7 +122,7 @@ Create two terminals:

.. code-block:: bash

$ python ./run-tests.py --tests tests_workspacebuilder
$ py.test tests/test_workspacebuilder.py

Terminal 1 should have flickered and built the session before your eyes.
tmuxp hides this building from normal users.
Expand All @@ -143,7 +142,7 @@ To run all tests upon editing any ``.py`` file:

.. code-block:: bash

$ find . -type f -not -path '*/\.*' | grep -i '.*[.]py$' | entr -c ./run-tests.py
$ make watch_test

.. _entr: http://entrproject.org/

Expand All @@ -152,7 +151,7 @@ Rebuild the documentation when an ``.rst`` file is edited:
.. code-block:: bash

$ cd doc
$ find .. -print | grep -i '.*[.]rst' | entr -c make html
$ make watch

.. _tmuxp developer config:

Expand Down