How to write parametrized tests in Python with pytest 🎥

Hi 👋 Welcome to another video tutorial on how to write parametrized tests in Python using pytest. If you want to follow along, here’s the code that I’ve tested in the video. from typing import List class Solution: def move_zeroes(self, nums: List[int]) -> None: last_zero = 0 index = 0 while index < len(nums): if nums[index] != 0: nums[last_zero], nums[index] = nums[index], nums[last_zero] last_zero += 1 index += 1 def main(): solution = Solution() arr = [1,0,1] solution....

September 30, 2021 · 1 min · Denis Nuțiu

Testing Python projects with Tox

Hi 👋 In this article I will show you how to test your Python projects with Tox. Introduction Tox is a tool for automating testing in Python, their vision is to standardize the testing process. It can be used to easily test your project using multiple Python interpreters and run various commands. Getting Started To get started all you need to add to your project is a tox.ini file. To simplify running the tests we will make use of the following Dockerfile, which contains Python interpreters for 3....

July 29, 2021 · 3 min · Denis Nuțiu