assert_called_anytime clears the callstack

Bug #1210292 reported by Peter Hamilton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Low
Peter Hamilton

Bug Description

Location: cinderclient/tests/fakes/FakeClient
Method: assert_called_anytime

The method clears the callstack if no assert is raised. Any test that makes multiple calls to assert_called_anytime will fail since any call made to assert_called_anytime after the first call will have no history to compare against. I propose simply deleting the final line in the method (the line that clears the callstack) to fix this.

Tags: tests
Changed in python-cinderclient:
assignee: nobody → Peter Hamilton (peter-hamilton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (master)

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

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

Reviewed: https://review.openstack.org/41521
Committed: http://github.com/openstack/python-cinderclient/commit/41cf3f193be7320f069963679889ef43662c490b
Submitter: Jenkins
Branch: master

commit 41cf3f193be7320f069963679889ef43662c490b
Author: Peter Hamilton <email address hidden>
Date: Mon Aug 12 08:55:22 2013 -0400

    Fixing erroneous clearing of test callstack

    This modification addresses Bug #1210292, specifically addressing
    the case where the test framework callstack is cleared when no
    asserts are raised in assert_called_anytime. This test method
    verifies that a specific API method call was made at any time
    during a test. If a test makes multiple calls to this method, and
    the first call yields no assertions, the subsequent calls will fail
    because the first assert in the method verifies that the callstack
    is non-empty. The error itself likely exists because
    assert_called_anytime is not currently used in the
    python-cinderclient testing framework.

    The fix involves deleting the last line in the method that clears
    the callstack.

    Fixes: bug 1210292

    Change-Id: I8b7b740957841a328b2f0ca888190f758cbdd234

Changed in python-cinderclient:
status: In Progress → Fix Committed
Changed in python-cinderclient:
milestone: none → 1.3.1
status: Fix Committed → Fix Released
Eric Harney (eharney)
Changed in python-cinderclient:
importance: Undecided → Low
tags: added: tests
removed: test
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.