mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 12:34:43 +00:00
82ecf8a416
- Change the layout and contents of docs to be better organised and follow ideas from: https://www.divio.com/blog/documentation/ - Use markdown for non-technical documents to speed up writing. - Added new sections and imported documents from Trac wiki. Build fixes: - Added a patch to fix recommonmark 0.4 and doc referencing: https://github.com/rtfd/recommonmark/issues/93 - Set docs build in tox to Py2.7 since there are problems with autodoc mocking multiple inheritance on Python 3 resulting in metaclass errors. - Supressed warning about `modules.rst` not in the toctree by creating a static `modules.rst` with `:orphan:` file directive and add to git. Also skip creating this toc file with sphinx-apidoc in setup and tox. - Simplified finding exported RPC and JSON API methods by adding an autodoc custom class directive. Removed unneeded __rpcapi.py.
65 lines
1.7 KiB
Markdown
65 lines
1.7 KiB
Markdown
# Running tests
|
|
|
|
Deluge testing is implemented using Trial which is Twisted's testing framework
|
|
and an extension of Python's unittest.
|
|
|
|
See Twisted website for documentation on [Twisted Trial](http://twistedmatrix.com/trac/wiki/TwistedTrial)
|
|
and [Writing tests using Trial](http://twistedmatrix.com/documents/current/core/howto/testing.html).
|
|
|
|
## Testing
|
|
|
|
The tests are located in the source folder under `deluge/tests`.
|
|
The tests are run from the project root directory.
|
|
View the unit test coverage at: [deluge-torrent.github.io](http://deluge-torrent.github.io)
|
|
|
|
### Trial
|
|
|
|
Here are some examples that show running all the test through to selecting an
|
|
individual test.
|
|
|
|
trial deluge
|
|
trial deluge.tests.test_client
|
|
trial deluge.tests.test_client.ClientTestCase
|
|
trial deluge.tests.test_client.ClientTestCase.test_connect_localclient
|
|
|
|
### Pytest
|
|
|
|
pytest deluge/tests
|
|
pytest deluge/tests/test_client.py
|
|
pytest deluge/tests/test_client.py -k test_connect_localclient
|
|
|
|
### Plugin
|
|
|
|
Running the tests for a specific plugin (requires [pytest](https://pypi.python.org/pypi/pytest)):
|
|
|
|
pytest deluge/plugins/<name-of-plugin>
|
|
|
|
## Tox
|
|
|
|
All the tests for Deluge can be run using [tox](https://pypi.python.org/pypi/tox)
|
|
|
|
#### See available targets:
|
|
|
|
tox -l
|
|
py27
|
|
py3
|
|
lint
|
|
docs
|
|
|
|
#### Run specific test:
|
|
|
|
tox -e py3
|
|
|
|
#### Verify code with pre-commit:
|
|
|
|
tox -e lint
|
|
|
|
## Travis-ci
|
|
|
|
Deluge develop branch is tested automatically by [Travis].
|
|
When creating a pull request (PR) on [github], Travis will be automatically run
|
|
the unit tests with the code in the PR.
|
|
|
|
[travis]: https://travis-ci.org/deluge-torrent/deluge
|
|
[github]: https://github.com/deluge-torrent/deluge/pulls
|