Add support for conditional Skipping of unittests
Bug #814192 reported by
Rohit Karajgi
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Wishlist
|
Justin Shepherd |
Bug Description
Currently the unit-test code does not support skipIf(condition). Only a nose.skip plugin is used for skipping tests. More flexibility is required for skipping tests.
We need to have this support for situations where a unit test needs to be skipped due to module errors. Eg. Skip a test if libvirt/libxml2 is not installed.
A decorator can be written for skipIf and provided to the test classes.
This support is available in the unittest2 library
Related branches
lp:~jshepher/nova/lp814192
- Vish Ishaya (community): Approve
- Trey Morris (community): Approve
- Jason Kölker (community): Approve
- William Wolf (community): Approve
- termie: Pending requested
-
Diff: 101 lines (+80/-2)2 files modifiednova/test.py (+33/-2)
nova/tests/test_skip_examples.py (+47/-0)
description: | updated |
Changed in nova: | |
assignee: | nobody → Justin Shepherd (jshepher) |
status: | Confirmed → In Progress |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → diablo-4 |
Changed in nova: | |
milestone: | diablo-4 → 2011.3 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
This was tried by Brian Lamar in https:/ /code.launchpad .net/~blamar/ nova/libvirt- cleanup- branch/ +merge/ 66064
See the last comment from Monty: unfortunately skipIf is throwing a SkipTest error, which breaks our test harness. So this needs some extra care. Note that we already do conditional skipping with skip_test... is there a specific feature missing there ?