pywbem/0006-fix_unit_tests.patch
Tony Asleson db062755f6 Add gating
Resolves: RHEL-47150

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2024-07-17 15:25:01 -05:00

94 lines
4.3 KiB
Diff

diff --git a/makefile b/makefile
index 9fd86eeb..959f83af 100644
--- a/makefile
+++ b/makefile
@@ -721,7 +721,7 @@ endif
.PHONY: test
test: $(test_deps)
@echo "makefile: Running unit and function tests"
- py.test --color=yes --cov $(package_name) --cov $(mock_package_name) $(coverage_report) --cov-config coveragerc $(pytest_warning_opts) $(pytest_opts) tests/unittest tests/functiontest -s
+ py.test $(pytest_warning_opts) $(pytest_opts) tests/unittest tests/functiontest -s -v
@echo "makefile: Done running tests"
.PHONY: installtest
diff --git a/tests/functiontest/conftest.py b/tests/functiontest/conftest.py
index 42936f88..44e89845 100644
--- a/tests/functiontest/conftest.py
+++ b/tests/functiontest/conftest.py
@@ -207,7 +207,7 @@ def patched_makefile(self, mode='r', bufsize=-1):
else:
timeout = self.timeout
t.join(timeout)
- if t.isAlive():
+ if t.is_alive():
raise socket.timeout
return self.fd
diff --git a/tests/unittest/pywbem/test_recorder.py b/tests/unittest/pywbem/test_recorder.py
index 5caf7f12..2436acc9 100755
--- a/tests/unittest/pywbem/test_recorder.py
+++ b/tests/unittest/pywbem/test_recorder.py
@@ -1611,11 +1611,11 @@ class LogOperationRecorderTests(BaseLogOperationRecorderTests):
"classname='CIM_Foo', "
"keybindings=NocaseDict({'Chicken': 'Ham'}), "
"namespace='root/cimv2', host='woot.com'), "
- "Params=OrderedDict(["
- "('StringParam', 'Spotty'), "
- "('Uint8', Uint8(cimtype='uint8', minvalue=0, maxvalue=255, 1)), "
- "('Sint8', Sint8(cimtype='sint8', minvalue=-128, maxvalue=127, 2))"
- "]))")
+ "Params=OrderedDict({"
+ "'StringParam': 'Spotty', "
+ "'Uint8': Uint8(cimtype='uint8', minvalue=0, maxvalue=255, 1), "
+ "'Sint8': Sint8(cimtype='sint8', minvalue=-128, maxvalue=127, 2)})"
+ ")")
result_ret = "Return:test_id InvokeMethod(tuple )"
diff --git a/tests/unittest/test_wbemcli.py b/tests/unittest/test_wbemcli.py
index 45a77a1c..2078e697 100755
--- a/tests/unittest/test_wbemcli.py
+++ b/tests/unittest/test_wbemcli.py
@@ -59,8 +59,8 @@ input requests as soon as the interactive shell is started.
Use h() in thenteractive shell for help for wbemcli methods and variables.
-Deprecated: The wbemcli command has been deprecated in pywbem 0.15.0.
-Version 1.0.0 of pywbem will remove the wbemcli command.
+Deprecated: The ~CMDLINE_EXE~ command has been deprecated in pywbem 0.15.0.
+Version 1.0.0 of pywbem will remove the ~CMDLINE_EXE~ command.
The recommended replacement is to use the pywbemcli command from the
pywbemtools package on Pypi.
@@ -130,7 +130,7 @@ Connection security related options:
then be part of the certfile
General options:
- -s [scripts [scripts ...]], --scripts [scripts [scripts ...]]
+ -s [scripts ...], --scripts [scripts ...]
Execute the python code defined by the script before the
user gets control. This argument may be repeated to load
multiple scripts or multiple scripts may be listed for a
@@ -139,7 +139,7 @@ General options:
-v, --verbose Print more messages while processing
-V, --version Display pywbem version and exit.
--statistics Enable gathering of statistics on operations.
- --mock-server [file name [file name ...]]
+ --mock-server [file name ...]
Activate pywbem_mock in place of a live WBEMConnection
and compile/build the files defined (".mof" suffix or
"py" suffix. MOF files are compiled and python files
diff --git a/tests/utils.py b/tests/utils.py
index 06ec6a85..1d661cd0 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -48,7 +48,7 @@ def skip_if_moftab_regenerated():
if test_installed:
# The mofparsetab and moflextab files should not be auto-generated
# in this case.
- pytest.fail("Cannot run this MOF testcase against an installed "
+ pytest.skip("Cannot run this MOF testcase against an installed "
"pywbem (version {0}, installed at {1}) "
"because that installation does not contain the "
"mofparsetab.py or moflextab.py files".