few unit tests (class TestMasakariAPI) are failing

Asked by Rohanil Raje

I installed all requirements and test-requirements modules.
Then I ran unittest using pytest framework but 3 of them are failing and others are passing.

```
$ pytest -k unit

===================================================================================== FAILURES ======================================================================================
_____________________________________________________________________ TestMasakariAPI.test_continues_on_failure _____________________________________________________________________
NOTE: Incompatible Exception Representation, displaying natively:

_StringException: Traceback (most recent call last):
TypeError: test_continues_on_failure() takes exactly 2 arguments (1 given)

_____________________________________________________________________ TestMasakariAPI.test_fails_if_all_failed ______________________________________________________________________
NOTE: Incompatible Exception Representation, displaying natively:

_StringException: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
TypeError: test_fails_if_all_failed() takes exactly 3 arguments (2 given)

____________________________________________________________________ TestMasakariAPI.test_fails_if_none_started _____________________________________________________________________
NOTE: Incompatible Exception Representation, displaying natively:

_StringException: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
TypeError: test_fails_if_none_started() takes exactly 3 arguments (2 given)

```

Each of them are saying there are extra argument passed to test functions. The extra argument is version_cache whose origin could not be found by me. I tried to remove version_cache from tests then there were further more issues.

Question information

Language:
English Edit question
Status:
Answered
For:
masakari Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
SamP (sampath-priyankara) said :
#1

Hi Rohanil,
 Same as in masakari, most of the opnstack projects use tox to run unit tests.
 https://wiki.openstack.org/wiki/Testing
 Is there any specific reason for why you used pytest?

Revision history for this message
Rohanil Raje (rohanil) said :
#2

Hi Sampath,
When I tried with tox, those 3 unittests are not being run. I did not try to find the cause but is it expected to happen?

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Rohanil Raje for more information if necessary.

To post a message you must log in.