UnitTests

From GNU MediaGoblin Wiki
(Difference between revisions)
Jump to: navigation, search
(Unit tests)
 
(One intermediate revision by one user not shown)
Line 3: Line 3:
 
FIXME - i think there's some information in chris' brain dumps page that should get ported here.  
 
FIXME - i think there's some information in chris' brain dumps page that should get ported here.  
  
In the meantime, if you're interested in helping with unit tests, come see us in #mediagoblin on freenode.net or email press@gnu.org
+
In the meantime, if you're interested in helping with unit tests, come see us in #mediagoblin on freenode.net.
 
+
  
 
== Running the unit tests ==
 
== Running the unit tests ==
Line 18: Line 17:
 
For example:
 
For example:
  
     ./runtests.sh mediagoblin.tests.test_auth:test_authentication_views
+
     ./runtests.sh mediagoblin/tests/test_submission.py::TestSubmissionBasics::test_collection_selection
  
<tt>runtests.sh</tt> does some minor setup and calls nosetests.  If you pass in <tt>-h</tt>, you'll get the
+
<tt>runtests.sh</tt> does some minor setup and calls py.test.  If you pass in <tt>-h</tt>, you'll get the
nosetests help which shows you options for other things you can do with the unit test system.
+
py.test help which shows you options for other things you can do with the unit test system.  For details see the [https://docs.pytest.org/en/latest/usage.html pytest] documentation.

Latest revision as of 03:03, 19 September 2019

[edit] Unit tests

FIXME - i think there's some information in chris' brain dumps page that should get ported here.

In the meantime, if you're interested in helping with unit tests, come see us in #mediagoblin on freenode.net.

[edit] Running the unit tests

To run the unit tests, do:

   ./runtests.sh

To run a specific test, do:

   ./runtests.sh <TEST>

For example:

   ./runtests.sh mediagoblin/tests/test_submission.py::TestSubmissionBasics::test_collection_selection

runtests.sh does some minor setup and calls py.test. If you pass in -h, you'll get the py.test help which shows you options for other things you can do with the unit test system. For details see the pytest documentation.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox