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

PREVIOUS NEXT
Code Example
Python :: python matplotlib pyplot 
Python :: wikipedia python 
Python :: save a file as a pickle 
Python :: django post request 403 forbidden 
Python :: python timestamp 
Python :: create python file kali linux 
Python :: taking string input from user in python with try except 
Python :: webbrowser.google.open python 
Python :: from imblearn.over_sampling import smote error 
Python :: delete specific indeces from numpy array 
Python :: generic python 
Python :: enumerate python 
Python :: look through dict 
Python :: plot histogram python 
Python :: pandas concatenate 
Python :: python apply function to dictionary values 
Python :: python ascii caesar cipher 
Python :: find how many of each columns value pd 
Python :: how to delete a specific line in a file 
Python :: how to check nth prime in python 
Python :: lista to txt python 
Python :: get month name from datetime pandas 
Python :: descending python dataframe df 
Python :: numpy standard deviation 
Python :: replace character in column 
Python :: python save output to file 
Python :: pyautogui color 
Python :: pathlib path exists 
Python :: save and load model pytorch 
Python :: python naming conventions 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =