Base test case should stop mock patches

Bug #1290550 reported by Kevin Benton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Kevin Benton

Bug Description

Currently if a unit test creates a patch and does not stop it, the patch will hang around and could potentially affect other tests that rely on the mocked class/method. This can make it difficult for developers creating new tests as unrelated tests could be causing new ones to sporadically fail or vice versa depending on concurrency and test order.

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/79448

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/79448
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=1dfd65f4cff1133cff45e103083fc3ae3130877b
Submitter: Jenkins
Branch: master

commit 1dfd65f4cff1133cff45e103083fc3ae3130877b
Author: Kevin Benton <email address hidden>
Date: Mon Mar 10 20:49:51 2014 +0000

    Stop mock patches by default in base test class

    Adds a mock.patch.stopall to the base unit test
    case cleanup routines to stop patches by default
    in unit tests. This behavior can be overwritten
    by setting an attribute on the test class if
    required.

    Also removes the explicit stops in the Cisco n1kv,
    VMware, and NEC unit tests to leverage the new
    automatic cleanup.

    Closes-Bug: #1290550
    Change-Id: Ic642430a765ea8deb07ebd88b619da58a58e0edd

Changed in neutron:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in neutron:
milestone: none → icehouse-rc1
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-rc1 → 2014.1
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.