Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pytest for loop

import pytest
from squares import *

@pytest.mark.parametrize("test_input, expected", [(1,1), (2,4), (3,9), (4,16)])
def test_squares(test_input, expected):
  assert square(test_input) == expected
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pytest #loop
ADD COMMENT
Topic
Name
2+3 =