Properly use _ in tests

Bug #1446411 reported by Tim Hinrichs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
congress
Fix Released
Low
Amey Bhide

Bug Description

We noticed in congress/tests/test_congress.py that there are many instances where there is a function returns multiple values, and we do not properly use an underscore for the ones that are unused.

In test_policy_execute_no_args(), we see...

        (id3, rule3) = self.api['rule'].add_item(
            {'rule': 'q(2)'}, {}, context={'policy_id': 'alice'})

and then never use 'rule3'. It would be easier to understand this code if it were written...

        (id3, _) = self.api['rule'].add_item(
            {'rule': 'q(2)'}, {}, context={'policy_id': 'alice'})

Amey Bhide (abhide)
Changed in congress:
assignee: nobody → Amey Bhide (abhide)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to congress (master)

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

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

Reviewed: https://review.openstack.org/175721
Committed: https://git.openstack.org/cgit/openstack/congress/commit/?id=973736067f4a28ec535f8425e69c43839d0fe2e5
Submitter: Jenkins
Branch: master

commit 973736067f4a28ec535f8425e69c43839d0fe2e5
Author: Amey Bhide <email address hidden>
Date: Mon Apr 20 22:46:14 2015 -0700

    Fix tests to use _ for unused varible

    Closes-Bug: #1446411
    Change-Id: Ia9796bfa87f3273f615baeabcc50cc87914fb7d0

Changed in congress:
status: In Progress → Fix Committed
Tim Hinrichs (thinrichs)
Changed in congress:
milestone: none → kilo-3
status: Fix Committed → Fix Released
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.