AttributeError: 'TokensV3Test' object has no attribute 'roles_client'

Bug #1652572 reported by tinytmy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Won't Fix
Undecided
Unassigned

Bug Description

when use 'nosetests -s --logging-level ERROR /root/tempest/tempest/api/identity/v3/test_users.py', it report error
'AttributeError: 'IdentityV3UsersTest' object has no attribute 'roles_client''.
In this line:
https://github.com/openstack/tempest/blob/master/tempest/api/identity/base.py#L78
The function 'def setup_test_role' can not be here, it maybe place to BaseIdentityV2AdminTest and BaseIdentityV3AdminTest.

Revision history for this message
Andrea Frittoli (andrea-frittoli) wrote :

setup_test_role is a function that creates roles; while the error you're seeing is related to the roles_client alias not being set in the tests. They don't seem related to me?

Note that we do not support nosetests as a test runner, I would recommend you try with testr or testtools as test runners.

Changed in tempest:
status: New → Incomplete
Revision history for this message
tinytmy (tangmeiyan77) wrote :

setup_test_role is defined in class BaseIdentityTest, but calss BaseIdentityV2Test and class BaseIdentityV3Test inherit from BaseIdentityTest. BaseIdentityV2Test and BaseIdentityV3Test do not need this setup_test_role function. Althought they may be not run this function when use tempest or testr. I think it is better to complete in BaseIdentityV2AdminTest and BaseIdentityV3AdminTest.

tinytmy (tangmeiyan77)
Changed in tempest:
status: Incomplete → Opinion
status: Opinion → New
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Actually here issue is with nosetests, it load any function with "test" string as tests case. So all *_test_* method are being run as test case.

This came up earlier also and it does not add much value to fix function name for such issue.

Tempest does not support nosetests, and we recommend to run with testr or tempest run command or any other test runners.

Changed in tempest:
status: New → Won't Fix
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.