Skip to content

Commit

Permalink
remove unittest from these classes, it won't work well with pytest pa…
Browse files Browse the repository at this point in the history
…rametrize
  • Loading branch information
brondsem committed Mar 12, 2024
1 parent 15ff11b commit d44e0aa
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Allura/allura/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from allura.lib.decorators import event_handler, task


class TestRepoTasks(unittest.TestCase):
class TestRepoTasks:

def setup_method(self, method):
setup_basic_test()
Expand Down Expand Up @@ -100,7 +100,7 @@ def _task_that_creates_event(event_name,):
assert not M.MonQTask.query.get(task_name='allura.tasks.event_tasks.event', args=[event_name])


class TestEventTasks(unittest.TestCase):
class TestEventTasks:

def setup_method(self, method):
setup_basic_test()
Expand Down Expand Up @@ -158,7 +158,7 @@ def test_compound_error(self):
assert ('assert %d' % x) in t.result


class TestIndexTasks(unittest.TestCase):
class TestIndexTasks:

def setup_method(self, method):
setup_basic_test()
Expand Down Expand Up @@ -243,7 +243,7 @@ def test_del_artifacts(self, solr):
solr.delete.assert_called_once_with(q=solr_query)


class TestMailTasks(unittest.TestCase):
class TestMailTasks:

def setup_method(self, method):
setup_basic_test()
Expand Down Expand Up @@ -570,7 +570,7 @@ def test_send_usermentions_notification(self):
assert 'auth/subscriptions#notifications' in text


class TestNotificationTasks(unittest.TestCase):
class TestNotificationTasks:

def setup_method(self, method):
setup_basic_test()
Expand Down Expand Up @@ -605,7 +605,7 @@ def index(self):
text=self.text)


class TestExportTasks(unittest.TestCase):
class TestExportTasks:

def setup_method(self, method):
setup_basic_test()
Expand All @@ -621,13 +621,11 @@ def test_bulk_export_filter_exportable(self):
exportable = mock.Mock(exportable=True)
not_exportable = mock.Mock(exportable=False)
BE = export_tasks.BulkExport()
self.assertEqual(
BE.filter_exportable([None, exportable, not_exportable]), [exportable])
assert BE.filter_exportable([None, exportable, not_exportable]) == [exportable]

def test_bulk_export_filter_successful(self):
BE = export_tasks.BulkExport()
self.assertEqual(
BE.filter_successful(['foo', None, '0']), ['foo', '0'])
assert BE.filter_successful(['foo', None, '0']) == ['foo', '0']

@mock.patch('allura.tasks.export_tasks.shutil')
@mock.patch('allura.tasks.export_tasks.zipdir')
Expand Down Expand Up @@ -659,7 +657,7 @@ def test_bulk_export_status(self):
assert c.project.bulk_export_status() == 'busy'


class TestAdminTasks(unittest.TestCase):
class TestAdminTasks:

def test_install_app_docstring(self):
assert 'ep_name, mount_point=None' in admin_tasks.install_app.__doc__
Expand Down

0 comments on commit d44e0aa

Please sign in to comment.