Use pytest instead of nosetests
Nose has been in maintenance mode for the past several years and pytest is a good replacement. Other changes: - Replace deprecated assertRegexpMatches with assertRegex - Replace deprecated assertRaisesRegexp with assertRaisesRegex - Replace deprecated SafeConfigParser with ConfigParser - Force reinstall pytest and mock in tox virtualenv. This is because the globally installed packages may not work as expected(occured in jenkins job). JIRA: RHELCMP-1619 Signed-off-by: Haibo Lin <hlin@redhat.com>
This commit is contained in:
parent
495a4c48b2
commit
3c72755814
13 changed files with 51 additions and 54 deletions
|
|
@ -1341,7 +1341,7 @@ class TestGetProductIds(PungiTestCase):
|
|||
get_productids_from_scm(self.compose)
|
||||
|
||||
self.assertEqual(get_dir_from_scm.call_args_list, [mock.call(cfg, mock.ANY)])
|
||||
self.assertRegexpMatches(
|
||||
self.assertRegex(
|
||||
str(ctx.exception),
|
||||
r"No product certificate found \(arch: amd64, variant: (Everything|Client)\)", # noqa: E501
|
||||
)
|
||||
|
|
@ -1365,6 +1365,4 @@ class TestGetProductIds(PungiTestCase):
|
|||
get_productids_from_scm(self.compose)
|
||||
|
||||
self.assertEqual(get_dir_from_scm.call_args_list, [mock.call(cfg, mock.ANY)])
|
||||
self.assertRegexpMatches(
|
||||
str(ctx.exception), "Multiple product certificates found.+"
|
||||
)
|
||||
self.assertRegex(str(ctx.exception), "Multiple product certificates found.+")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue