Changes between Version 2 and Version 3 of Development/Testing


Ignore:
Timestamp:
10/19/2014 05:29:13 PM (10 years ago)
Author:
bro
Comment:

Updated with travis and tox and example of plugin test with pytest

Legend:

Unmodified
Added
Removed
Modified
  • Development/Testing

    v2 v3  
     1[[PageOutline(2-4,,inline)]] 
     2 
    13= Unit Testing = 
    24 
    3 Deluge testing is performed using Trial which is Twisted's testing framework and an extension of Python's unittest. Full documentation for Trial can be found on the Twisted website: 
     5Deluge testing is implemented using Trial which is Twisted's testing framework and an extension of Python's unittest. Full documentation for Trial can be found on the Twisted website: 
    46 
    57 * [http://twistedmatrix.com/trac/wiki/TwistedTrial Twisted Trial] 
     
    79 * [http://twistedmatrix.com/documents/11.1.0/api/twisted.trial.unittest.html Trial Unittest Docs] 
    810 
     11== Development branch (git develop) == 
     12 
     13The tests are located in the source folder under `deluge/tests`.  
     14 
     15The tests are run from the project root directory. 
     16 
    917Here are some examples that show running all the test through to selecting an individual test.  
    10  
    11 For development branch (git master), tests are located in the source folder under 'deluge/tests'. 
    1218{{{ 
    1319trial deluge 
     
    1723}}} 
    1824 
     25Running the tests for a specific plugin (requires [https://pypi.python.org/pypi/pytest pytest]): 
     26{{{ 
     27py.test deluge/plugins/<name-of-plugin> 
     28}}} 
    1929 
    20 For 1.3-stable, tests are located in the top level folder of source under `tests`. 
     30=== Tox === 
     31All the tests for Deluge can be run using [https://pypi.python.org/pypi/tox tox] 
     32 
     33See available targets: 
     34{{{ 
     35 tox -l 
     36 py27 
     37 flake8 
     38 isort 
     39 docs 
     40}}} 
     41 
     42Run specific test: 
     43{{{ 
     44 tox -e pydef 
     45}}} 
     46 
     47Verify code with flake8 and isort: 
     48{{{ 
     49 tox -e flake8,isort 
     50}}} 
     51 
     52=== Travis-ci === 
     53Deluge develop branch is tested automatically by [https://travis-ci.org/deluge-torrent/deluge Travis-ci] 
     54 
     55When creating a pull request (PR) on [https://github.com/deluge-torrent/deluge/pulls github], Travis will be automatically run the unit tests with the code in the PR. 
     56 
     57 
     58== 1.3 branch == 
     59 
     60The tests are located in the top level folder of source under `tests`. 
    2161{{{ 
    2262cd tests