fix tests according to pytests warnings

This commit is contained in:
Tomas Kopecek 2022-10-24 10:40:50 +02:00
parent 79d3750629
commit 2daa71614e
8 changed files with 10 additions and 10 deletions

View file

@ -106,4 +106,4 @@ class TestBuildNotification(unittest.TestCase):
if six.PY2:
msg_expect = msg_expect.decode()
self.assertMultiLineEqual(message.decode(), msg_expect.decode())
locale.resetlocale()
locale.setlocale(locale.LC_ALL, "")

View file

@ -45,7 +45,7 @@ class TestBuildinfo(utils.CliTestCase):
'volume_name': 'DEFAULT'}
def tearDown(self):
locale.resetlocale()
locale.setlocale(locale.LC_ALL, "")
if self.original_timezone is None:
del os.environ['TZ']
else:

View file

@ -43,7 +43,7 @@ class TestHostinfo(utils.CliTestCase):
self.ensure_connection_mock = mock.patch('koji_cli.commands.ensure_connection').start()
def tearDown(self):
locale.resetlocale()
locale.setlocale(locale.LC_ALL, "")
if self.original_timezone is None:
del os.environ['TZ']
else:

View file

@ -40,7 +40,7 @@ class TestListHosts(utils.CliTestCase):
'user_id': 2}]
def tearDown(self):
locale.resetlocale()
locale.setlocale(locale.LC_ALL, "")
if self.original_timezone is None:
del os.environ['TZ']
else:

View file

@ -60,7 +60,7 @@ class TestRpminfo(utils.CliTestCase):
""" % (self.progname, self.progname)
def tearDown(self):
locale.resetlocale()
locale.setlocale(locale.LC_ALL, "")
if self.original_timezone is None:
del os.environ['TZ']
else:

View file

@ -91,7 +91,7 @@ class TestRecycleBuild(unittest.TestCase):
def test_recycle_states_good(self):
for state in 'FAILED', 'CANCELED':
yield self.check_recycle_states_good, koji.BUILD_STATES[state]
self.check_recycle_states_good, koji.BUILD_STATES[state]
def check_recycle_states_good(self, state):
new = self.new.copy()
@ -121,7 +121,7 @@ class TestRecycleBuild(unittest.TestCase):
def test_recycle_states_bad(self):
for state in 'BUILDING', 'COMPLETE', 'DELETED':
yield self.check_recycle_states_bad, koji.BUILD_STATES[state]
self.check_recycle_states_bad, koji.BUILD_STATES[state]
def check_recycle_states_bad(self, state):
new = self.new.copy()
@ -140,7 +140,7 @@ class TestRecycleBuild(unittest.TestCase):
[[], True, []],
]
for values in vlists:
yield self.check_recycle_query_bad, values
self.check_recycle_query_bad, values
def check_recycle_query_bad(self, values):
new = self.new.copy()

View file

@ -110,4 +110,4 @@ class TestFormatTime(unittest.TestCase):
r = formatTimeLong(d4)
self.assertEqual(r, desired)
locale.resetlocale()
locale.setlocale(locale.LC_ALL, "")

View file

@ -781,7 +781,7 @@ class MavenUtilTestCase(unittest.TestCase):
result = koji.util.formatChangelog(data)
self.assertMultiLineEqual(expect, result)
locale.resetlocale()
locale.setlocale(locale.LC_ALL, "")
def test_parseTime(self):
"""Test parseTime function"""