|
16 | 16 | def python_only_language(request):
|
17 | 17 | return request.param
|
18 | 18 |
|
19 |
| -def test_add_literal_int(python_only_language) : |
| 19 | +def test_add_literal_int(language) : |
20 | 20 | def add_int():
|
21 | 21 | a = {1,3,45}
|
22 | 22 | a.add(4)
|
23 |
| - return a |
24 |
| - epyc_add_element = epyccel(add_int, language = python_only_language) |
| 23 | + return len(a) |
| 24 | + epyc_add_element = epyccel(add_int, language = language) |
25 | 25 | pyccel_result = epyc_add_element()
|
26 | 26 | python_result = add_int()
|
27 | 27 | assert python_result == pyccel_result
|
28 | 28 |
|
29 |
| -def test_add_literal_complex(python_only_language) : |
| 29 | +def test_add_literal_complex(language) : |
30 | 30 | def add_complex():
|
31 | 31 | a = {6j,7j,8j}
|
32 | 32 | a.add(9j)
|
33 |
| - return a |
34 |
| - epyc_add_element = epyccel(add_complex, language = python_only_language) |
| 33 | + return len(a) |
| 34 | + epyc_add_element = epyccel(add_complex, language = language) |
35 | 35 | pyccel_result = epyc_add_element()
|
36 | 36 | python_result = add_complex()
|
37 | 37 | assert python_result == pyccel_result
|
38 | 38 |
|
39 |
| -def test_add_variable_int(python_only_language): |
| 39 | +def test_add_variable_int(language): |
40 | 40 | def add_element_range():
|
41 | 41 | a = {1, 2, 3}
|
42 | 42 | for i in range(50, 100):
|
43 | 43 | a.add(i)
|
44 |
| - return a |
45 |
| - epyc_add_element = epyccel(add_element_range, language = python_only_language) |
| 44 | + return len(a) |
| 45 | + epyc_add_element = epyccel(add_element_range, language = language) |
46 | 46 | pyccel_result = epyc_add_element()
|
47 | 47 | python_result = add_element_range()
|
48 | 48 | assert python_result == pyccel_result
|
@@ -335,51 +335,39 @@ def copy_from_arg2(a : 'set[float]'):
|
335 | 335 | assert isinstance(python_result, type(pyccel_result))
|
336 | 336 | assert python_result == pyccel_result
|
337 | 337 |
|
338 |
| -@pytest.fixture( params=[ |
339 |
| - pytest.param("fortran", marks = [ |
340 |
| - pytest.mark.skip(reason="set methods not implemented in fortran"), |
341 |
| - pytest.mark.fortran]), |
342 |
| - pytest.param("c", marks = pytest.mark.c), |
343 |
| - pytest.param("python", marks = pytest.mark.python) |
344 |
| - ], |
345 |
| - scope = "module" |
346 |
| -) |
347 |
| -def language_without_fortran(request): |
348 |
| - return request.param |
349 |
| - |
350 |
| -def test_Pop_int(language_without_fortran): |
| 338 | +def test_Pop_int(stc_language): |
351 | 339 | def Pop_int():
|
352 | 340 | se = {2, 4, 9}
|
353 | 341 | el1 = se.pop()
|
354 | 342 | el2 = se.pop()
|
355 | 343 | el3 = se.pop()
|
356 | 344 | return el1, el2, el3
|
357 |
| - epyccel_remove = epyccel(Pop_int, language = language_without_fortran) |
| 345 | + epyccel_remove = epyccel(Pop_int, language = stc_language) |
358 | 346 | pyccel_result = set(epyccel_remove())
|
359 | 347 | python_result = set(Pop_int())
|
360 | 348 | assert python_result == pyccel_result
|
361 | 349 |
|
362 |
| -def test_Pop_float(language_without_fortran): |
| 350 | +def test_Pop_float(stc_language): |
363 | 351 | def Pop_float():
|
364 | 352 | se = {2.3 , 4.1, 9.5}
|
365 | 353 | el1 = se.pop()
|
366 | 354 | el2 = se.pop()
|
367 | 355 | el3 = se.pop()
|
368 | 356 | return el1, el2, el3
|
369 |
| - epyccel_remove = epyccel(Pop_float, language = language_without_fortran) |
| 357 | + epyccel_remove = epyccel(Pop_float, language = stc_language) |
370 | 358 | pyccel_result = set(epyccel_remove())
|
371 | 359 | python_result = set(Pop_float())
|
372 | 360 | assert python_result == pyccel_result
|
373 | 361 |
|
374 | 362 |
|
375 |
| -def test_Pop_complex(language_without_fortran): |
| 363 | +def test_Pop_complex(stc_language): |
376 | 364 | def Pop_complex():
|
377 | 365 | se = {4j , 1j, 7j}
|
378 | 366 | el1 = se.pop()
|
379 | 367 | el2 = se.pop()
|
380 | 368 | el3 = se.pop()
|
381 | 369 | return el1, el2, el3
|
382 |
| - epyccel_remove = epyccel(Pop_complex, language = language_without_fortran) |
| 370 | + epyccel_remove = epyccel(Pop_complex, language = stc_language) |
383 | 371 | pyccel_result = set(epyccel_remove())
|
384 | 372 | python_result = set(Pop_complex())
|
385 | 373 | assert python_result == pyccel_result
|
0 commit comments