Make unit tests and functional tests work with pytest runner

Bug #2017973 reported by Tom Weininger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
In Progress
Undecided
Unassigned

Bug Description

Pytest is a superior test runner compared to stestr, at least for local test development and debugging. It supports running Python `unittest` type tests like Octavia implements. However, certain specifics of some test case implementations make it fail to run tests correctly. This is because pytest picks up tests based on their file name, class name and method name.

One example are the tests implemented in [1]. Test methods of the base class get picked up by pytest because of the class name, but it should only run them indirectly using the subclass.

Also, I noticed some instabilities when running unit tests in parallel with pytest and the test_get_member [2] test case fails because of a time out error.

[1]: https://opendev.org/openstack/octavia/src/commit/db03617acbc9b1ebf90fae6db79d5a10254eee2b/octavia/tests/unit/api/v2/types/test_availability_zone_profile.py
[2]: https://opendev.org/openstack/octavia/src/commit/db03617acbc9b1ebf90fae6db79d5a10254eee2b/octavia/tests/functional/api/drivers/driver_agent/test_driver_agent.py#L311

Changed in octavia:
status: New → In Progress
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.