← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1805800] [NEW] misuse of assertTrue

 

Public bug reported:

There is the following statement in the test_fields_defaulted_at_create
method of the TestRequestGroupObject class in
nova/tests/unit/objects/test_request_spec.py (*1).

self.assertTrue(True, rg.use_same_provider)

It is always passed, so it is useless.
It should be as follows:

self.assertTrue(rg.use_same_provider)

*1:
https://github.com/openstack/nova/blob/3b2e42f37152a539472782ad1d71c1f951c0343b/nova/tests/unit/objects/test_request_spec.py#L842

** Affects: nova
     Importance: Undecided
     Assignee: Takashi NATSUME (natsume-takashi)
         Status: In Progress


** Tags: testing

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1805800

Title:
  misuse of assertTrue

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  There is the following statement in the
  test_fields_defaulted_at_create method of the TestRequestGroupObject
  class in nova/tests/unit/objects/test_request_spec.py (*1).

  self.assertTrue(True, rg.use_same_provider)

  It is always passed, so it is useless.
  It should be as follows:

  self.assertTrue(rg.use_same_provider)

  *1:
  https://github.com/openstack/nova/blob/3b2e42f37152a539472782ad1d71c1f951c0343b/nova/tests/unit/objects/test_request_spec.py#L842

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1805800/+subscriptions


Follow ups