Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pytest loop

import pytest

@pytest.mark.parametrize("num, output",[(1,11),(2,22),(3,35),(4,44)])
def test_multiplication_11(num, output):
   assert 11*num == output
Comment

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
Comment

pytest loop

import pytest

@pytest.mark.parametrize("num, output",[(1,11),(2,22),(3,35),(4,44)])
def test_multiplication_11(num, output):
   assert 11*num == output
Comment

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
Comment

PREVIOUS NEXT
Code Example
Python :: Python Tkinter CheckButton Widget 
Python :: pandas.core.indexes into list 
Python :: ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters 
Python :: how to calculate the google map distance in python 
Python :: python dict to string 
Python :: read csv in spark 
Python :: looping through the list 
Python :: size pilimage 
Python :: How to calculate accuracy with two lists in python 
Python :: np.zero 
Python :: convert int to ascii python 
Python :: hh:mm to mins in python 
Python :: fill_between matplotlib 
Python :: python collection 
Python :: txt to image python 
Python :: class in python 
Python :: python re.findall() 
Python :: python get time executed by function 
Python :: how to use replace in python 
Python :: geopandas with postgis 
Python :: how to access a file from root folder in python project 
Python :: django request.data example 
Python :: time in python 
Python :: round float python 
Python :: torch cos 
Python :: python program to demonstrate scoping 
Python :: new paragraph python 
Python :: django permissions 
Python :: python latest version 64 bit 
Python :: bash escape double quote windows batch 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =