https://bugzilla.wikimedia.org/show_bug.cgi?id=69183

Antoine "hashar" Musso <has...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |has...@free.fr

--- Comment #1 from Antoine "hashar" Musso <has...@free.fr> ---
tox is just a wrapper around virtualenv, it then execute a given command. In
this case 'nosetests'.  Good news, nosetests let one flag tests with an
attribute which can then be included/excluded at will using  --attr=.

I discussed about it with Pywikibot folks, they have unit tests and tests that
target the production site.   We wanted to prevent running tests again a site. 
What they ended up with is a base class for each kind of tests that adds an
attribute and let them skip tests running against a site.

Some magic code at: https://gerrit.wikimedia.org/r/#/c/151604/4/tests/utils.py


You could go with a ManualTestCase that will have an attribute manual_test .
Then exclude those tests by running: nosetests --attr='!manual_test'.    That
could be added to the commands= stanza in tox.ini

Note, you can create a new tox environment to execute the manual test easily
and end up with something like:

 # Default env executed for py26,py27 targets
 # Excludes manual tests
 [testenv]
 ...
 commands = nosetests --attr='!manual_test'

 # Only run manual tests, execute with: tox -emanual_test
 [testenv:manual_test]
 commands = nosetests --attr='manual_test'

 # produce coverage report
 [testenv:cover]
 commands = nosetests --attr='!manual_test' --with-coverage --cover-html

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to