[Tests] Remove reference to Twisted Trial
With the move to pytest remove remainings documentation or comments that refer to Trial.
This commit is contained in:
parent
a683b7e830
commit
11fe22e4cd
|
@ -10,7 +10,6 @@ docs/source/modules/deluge*.rst
|
|||
__pycache__/
|
||||
*.py[cod]
|
||||
*.tar.*
|
||||
_trial_temp
|
||||
.tox/
|
||||
deluge/i18n/*/
|
||||
deluge.pot
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
import pytest
|
||||
import pytest_twisted
|
||||
from twisted.internet import defer
|
||||
from twisted.trial import unittest
|
||||
|
||||
import deluge.component as component
|
||||
from deluge.common import fsize, fspeed
|
||||
|
@ -38,7 +37,7 @@ class TestStatsPlugin:
|
|||
def test_client_totals(self):
|
||||
plugins = yield client.core.get_available_plugins()
|
||||
if 'Stats' not in plugins:
|
||||
raise unittest.SkipTest('WebUi plugin not available for testing')
|
||||
pytest.skip('Stats plugin not available for testing')
|
||||
|
||||
totals = yield client.stats.get_totals()
|
||||
assert totals['total_upload'] == 0
|
||||
|
@ -51,7 +50,7 @@ class TestStatsPlugin:
|
|||
def test_session_totals(self):
|
||||
plugins = yield client.core.get_available_plugins()
|
||||
if 'Stats' not in plugins:
|
||||
raise unittest.SkipTest('WebUi plugin not available for testing')
|
||||
pytest.skip('Stats plugin not available for testing')
|
||||
|
||||
totals = yield client.stats.get_session_totals()
|
||||
assert totals['total_upload'] == 0
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#
|
||||
import pytest
|
||||
import pytest_twisted
|
||||
from twisted.trial import unittest
|
||||
|
||||
import deluge.component as component
|
||||
from deluge.core.core import Core
|
||||
|
@ -36,7 +35,7 @@ class TestWebUIPlugin:
|
|||
|
||||
def test_enable_webui(self):
|
||||
if 'WebUi' not in self.core.get_available_plugins():
|
||||
raise unittest.SkipTest('WebUi plugin not available for testing')
|
||||
pytest.skip('WebUi plugin not available for testing')
|
||||
|
||||
d = self.core.enable_plugin('WebUi')
|
||||
|
||||
|
|
|
@ -246,7 +246,6 @@ class TestDelugeTransferProtocol:
|
|||
assert rencode.dumps(self.msg1) == rencode.dumps(message3)
|
||||
|
||||
# Remove underscore to enable test, or run the test directly:
|
||||
# tests $ trial test_transfer.DelugeTransferProtocolTestCase._test_rencode_fail_protocol
|
||||
def _test_rencode_fail_protocol(self):
|
||||
"""
|
||||
This test tries to test the protocol that relies on errors from rencode.
|
||||
|
|
|
@ -29,7 +29,7 @@ try:
|
|||
# Install twisted reactor, before any other modules import reactor.
|
||||
reactor = gtk3reactor.install()
|
||||
except ReactorAlreadyInstalledError:
|
||||
# Running unit tests so trial already installed a rector
|
||||
# Running unit tests so already installed a rector
|
||||
from twisted.internet import reactor
|
||||
|
||||
# isort:imports-firstparty
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
# 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 uses [PyTest] framework and [PyTest-Twisted] to handle Twisted framework.
|
||||
|
||||
## Testing
|
||||
|
||||
|
@ -12,16 +8,6 @@ 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 tests 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
|
||||
|
@ -41,7 +27,6 @@ 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
|
||||
|
@ -54,11 +39,12 @@ All the tests for Deluge can be run using [Tox](https://pypi.python.org/pypi/tox
|
|||
|
||||
tox -e lint
|
||||
|
||||
## Travis CI
|
||||
## CI
|
||||
|
||||
Deluge develop branch is tested automatically by [Travis].
|
||||
When creating a pull request (PR) on [github], Travis will automatically run
|
||||
the unit tests with the code in the PR.
|
||||
Deluge develop branch is tested automatically by GitHub actions.
|
||||
|
||||
When creating a pull request (PR) on [github], units tests will be automatically be run.
|
||||
|
||||
[travis]: https://travis-ci.org/deluge-torrent/deluge
|
||||
[github]: https://github.com/deluge-torrent/deluge/pulls
|
||||
[pytest]: https://docs.pytest.org/en/
|
||||
[pytest-twisted]: https://github.com/pytest-dev/pytest-twisted
|
||||
|
|
6
tox.ini
6
tox.ini
|
@ -81,12 +81,6 @@ commands = pytest -m "gtkui" deluge/tests
|
|||
[testenv:todo]
|
||||
commands = pytest -m "todo" deluge/tests
|
||||
|
||||
[testenv:trial]
|
||||
setenv = {[testenv]setenv}{:}{toxinidir}/deluge/tests
|
||||
commands =
|
||||
python -c "import libtorrent as lt; print(lt.__version__)"
|
||||
python -m twisted.trial --reporter=deluge-reporter deluge.tests
|
||||
|
||||
[testenv:plugins]
|
||||
setenv = PYTHONPATH = {toxinidir}{:}{toxinidir}/deluge/plugins
|
||||
commands =
|
||||
|
|
Loading…
Reference in New Issue