Hyper-V tests can be refactored to avoid multiple mox.VerifyAll() calls

Bug #1177570 reported by Alessandro Pilotti
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
Unassigned

Bug Description

The Hyper-V tests, specifically test_hypervap.py are currently using the mox framework for all the tests.

As a result, it's possible to move the mox.VerifyAll() call from the single tests to tearDown().

The advantages are:

1) Less code bloathing due to duplicated VerifyAll() calls at
   the end of each individual test

2) Ensure that VerifyAll() is called in cases in which the developer might
   forget about adding it at the end of the test

Tags: hyper-v
Changed in nova:
assignee: nobody → Alessandro Pilotti (alexpilotti)
Revision history for this message
Michael Still (mikal) wrote :

Is this a good idea? I can't think of any other test which has its verify in the tear down. Are there existing examples?

Changed in nova:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Alessandro Pilotti (alexpilotti) wrote :

All our tests currently work with VerifyAll() in the tearDown except one, I'm currently investigating the cause.

I checked to be sure that asserts are properly logged and not masked by potential VerifyAll() exceptions.

description: updated
description: updated
Joe Gordon (jogo)
tags: added: hyper-v
Changed in nova:
assignee: Alessandro Pilotti (alexpilotti) → nobody
Revision history for this message
Claudiu Belu (cbelu) wrote :

Tests have been refactored during Kilo and Liberty. Final patch that merged in Liberty: https://review.openstack.org/#/c/139798/

No longer valid.

Changed in nova:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.