11import time
22import pytest
3- from src .thread import ParallelProcessing , exceptions
3+ from src .thread import ConcurrentProcessing , exceptions
44
55
66# >>>>>>>>>> Dummy Functions <<<<<<<<<< #
@@ -18,7 +18,7 @@ def _dummy_raiseException(x: Exception, delay: float = 0):
1818def test_threadsScaleDown ():
1919 """This test is for testing if threads scale down `max_threads` when the dataset is lesser than the thread count"""
2020 dataset = list (range (0 , 2 ))
21- new = ParallelProcessing (
21+ new = ConcurrentProcessing (
2222 function = _dummy_dataProcessor ,
2323 dataset = dataset ,
2424 max_threads = 4 ,
@@ -32,7 +32,7 @@ def test_threadsScaleDown():
3232def test_threadsProcessing ():
3333 """This test is for testing if threads correctly order data in the `dataset` arrangement"""
3434 dataset = list (range (0 , 500 ))
35- new = ParallelProcessing (
35+ new = ConcurrentProcessing (
3636 function = _dummy_dataProcessor , dataset = dataset , args = [0.001 ], daemon = True
3737 )
3838 new .start ()
@@ -43,7 +43,7 @@ def test_threadsProcessing():
4343def test_raises_StillRunningError ():
4444 """This test should raise ThreadStillRunningError"""
4545 dataset = list (range (0 , 8 ))
46- new = ParallelProcessing (
46+ new = ConcurrentProcessing (
4747 function = _dummy_dataProcessor , dataset = dataset , args = [1 ], daemon = True
4848 )
4949 new .start ()
@@ -54,7 +54,7 @@ def test_raises_StillRunningError():
5454def test_raises_RunTimeError ():
5555 """This test should raise a RunTimeError"""
5656 dataset = [RuntimeError ()] * 8
57- new = ParallelProcessing (
57+ new = ConcurrentProcessing (
5858 function = _dummy_raiseException , dataset = dataset , args = [0.01 ], daemon = True
5959 )
6060 with pytest .raises (RuntimeError ):
0 commit comments