Commit Graph

8 Commits

Author SHA1 Message Date
Alexandre Detiste
fb69627ad3
Use unittest.mock from core python everywhere
mock was an independent module that has been merged into the Python standard library.
2024-02-18 22:15:30 +01:00
Marcus Schäfer
cdbe5060ca
Move LoopDevice class to context manager
Change the LoopDevice class to be a context manager.
All code using LoopDevice was updated to the following
with statement:

with LoopDevice(...) as loop_provider:
    loop_provider.some_member()

This is related to Issue #2412
2024-01-11 19:18:01 +01:00
Marcus Schäfer
9c9250ebc4
Support nose and xunit style tests
The modifications in this commit allows the unit tests
to run on both, pytest 6.x (nose test layout) and the new
pytest 7.x (xunit test layout). This Fixes #2072 in a
much nicer way. Thanks much to @smarlowucf
2022-02-26 20:26:18 +01:00
Marcus Schäfer
1f869e7ca8
Revert "Unit test adaptions to pytest v7"
This reverts commit 0dc2e803e0.
The pytest interface from version v6 to v7 has received
changes which requires the tests to be adapted to work for
either the old or the new interface. As there are still many
distributions which uses v6 as the standard we decided to
revert back the adaptions done to support v7 and create
a version requirement to v6 in .virtualenv.dev-requirements.txt
This Fixes #2072
2022-02-26 20:19:42 +01:00
Marcus Schäfer
0dc2e803e0
Fixed unit tests
The pytest interface setup() method call has changed
in a way that an additional parameter is passed to
the method which leads to a python error at invocation
time if the setup method does not define it.
2022-02-07 21:27:39 +01:00
Marcus Schäfer
81bb72cf69
Complete strong typing for API methods
Added required code changes to let mypy pass when running
from the toplevel kiwi namespace. This now finally
Fixes #1644
2021-04-10 20:04:39 +02:00
Marcus Schäfer
bdb7123fa1
Refactor use of logging facility
Use getLogger method instead of a global log object
Also use caplog fixture to capture log messages in
unit tests. This Fixes #1244
2019-10-23 17:54:27 +02:00
David Cassany
4b3a105026
Re-structure unit tests folders
This commit relocates unit tests to a folder structure that matches
the source code structure.

Fixes #1128
2019-10-21 14:00:05 +02:00