pytest: Migrate unittest/nose to Pytest fixtures

Even though Pytest supports xunit style setups, unittest and nose
tests, this support is limited and may be dropped in the future
releases. Worst of all is that the mixing of various test
frameworks results in weird conflicts and of course, is not widely
tested.

This is a part of work to remove the mixing of test idioms in the
IPA's test suite:
1) replace unittest.TestCase subclasses
2) replace unittest test controls (SkipTest, fail, etc.)
3) replace unittest assertions

Related: https://pagure.io/freeipa/issue/7989
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Stanislav Levin
2019-10-15 13:24:11 +03:00
committed by Alexander Bokovoy
parent 292d686c0b
commit fec66942d4
25 changed files with 887 additions and 888 deletions

View File

@@ -25,7 +25,6 @@ from __future__ import absolute_import
import distutils.spawn
import os
import unittest
import pytest
@@ -69,6 +68,6 @@ class cmdline_test(XMLRPC_test):
'Command %r not available' % original_command
)
if not server_available:
raise unittest.SkipTest(
pytest.skip(
'Server not available: %r' % api.env.xmlrpc_uri
)