Skip to content

Commit

Permalink
added unit test for job pool
Browse files Browse the repository at this point in the history
  • Loading branch information
picciama committed Aug 10, 2023
1 parent 4b4b485 commit 937f542
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/unit_tests/test_job_pool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import unittest

from oktoberfest.utils.multiprocessing_pool import JobPool


def add_one(i: int):
"""Test function for multiprocessing pool."""
return i + 1


class TestJobPool(unittest.TestCase):
"""Test the JobPool class."""

def test_jobpool(self):
"""Unit test for starting and joining multiprocessing pool."""
pool = JobPool(2)
for i in range(5):
pool.apply_async(add_one, [i])
pool.check_pool()

0 comments on commit 937f542

Please sign in to comment.