Skip to content

Commit

Permalink
Agrego caso de prueba que muestra el no-manejo de excepciones en mult…
Browse files Browse the repository at this point in the history
…ithreading
  • Loading branch information
lucaslavandeira committed Oct 8, 2019
1 parent 10ddce3 commit deff707
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_threading.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import time
from unittest import TestCase

import nose

from pydatajson.threading_helper import apply_threading


Expand All @@ -14,3 +17,11 @@ def function(x):
result = apply_threading(elements, function, 3)

self.assertEqual(result, [1, 4, 9, 16])

def test_broken_function(self):
elements = [1, 2, 3, 0]

def divide(x):
return 6/x
with self.assertRaises(ZeroDivisionError): # Es "sincrónico"!
apply_threading(elements, divide, 3)

0 comments on commit deff707

Please sign in to comment.