Danny Crastoblog.danwald.me·Jan 21, 2025Dependent breaking pytest'sNew unit-tests were added that were passing when run in isolation. They were breaking when run all together by the CI/CD pipeline. Previous tests were affecting ours. The question was which ones? We thought it could be a data issue with persistent da...pytest
Animesh PathakforKeploy Community Blogkeploy.hashnode.dev·Jan 17, 2025Python Testing with Pytest: Features & Best PracticesThe importance that we give to developing the application with the software engineering best practices, and principles, the equal importance and significance lies to the unit testing side of the codebase. This is where Pytest, a robust, scalable, fea...pytest
Alishba MumtazforGDG NED Chroniclesgdgned.hashnode.dev·Dec 31, 2024Why Every Developer Should Learn the Basics of TestingLet’s be honest—testing isn’t the glamorous part of coding. It’s not the shiny feature you show off in standups or the clever algorithm that makes you feel like a genius. Testing is more like flossing. You know it’s good for you, but it’s easy to ski...12 likes·304 readsTesting
JAIME ELIAS FLORES QUISPEjaimeelias.hashnode.dev·Nov 21, 2024Article on Pytest for API Testing: Comparison with Karate and SuperTestIntroduction In this article, we will explore Pytest, a popular Python testing framework, in the context of testing RESTful APIs, comparing it with other popular frameworks like Karate (for Java) and SuperTest (for Node.js). The goal is to provide a ...@Karate(Java)
Anix Lynchgozeroshot.dev·Oct 4, 202420 Pytest concepts with Before-and-After Examples1. Setting up a Basic Test Function 🛠️ Boilerplate Code: def test_example(): assert 1 == 1 Use Case: Create a simple test function to verify basic functionality in your code. Goal: Write a basic pytest function to check if a condition holds tru...pytest
Hemachandrahemachandra.hashnode.dev·Sep 29, 2024How to test/mock Configuration files in PythonIntroduction We will be using configuration files in our projects so frequently that, without a configuration file, it becomes difficult to change the code each time. Why do we need a configuration file? Imagine I have created a project that runs on ...11 likes·108 readspytest
Simon Crowesimoncrowe.hashnode.dev·Sep 7, 2024Python Testing Part 1: isolating external calls and minimising mocksMocks are a necessary evil in Python testing. If overused, they essentially become "change detectors", meaning that every time you refactor the implementation of your code, you must update the mocks too. Ideally, your tests should verify what your co...32 readsPython
Danny Crastoblog.danwald.me·Sep 5, 2024Shorten pytest's test namesI noticed that the unittest pipeline was failing. I opened up the logs and saw a wall of text that took about 20 pages to scroll through to see what was failing. It turned out to be an Assert failure where the input wasn't raising an exception. The p...Python
Kunaal Thanikkunaal.hashnode.dev·Sep 5, 2024CH02 - PageObjects, Fixtures, PytestChapter 02 - how to use Page Object Models, Fixtures, pyTest mark, Environment Variables, pytest.ini and conftest Recap: https://kunaal.hashnode.dev/automation-ch01-initialization Previously, we set up the testing framework using Playwright and Pytho...Python Playwright UI Automationplaywright
Sadra Yahyapourblog.imsadra.me·Aug 9, 2024Python Open-Source Development: How I Build and Maintain Open-Source Repositories!Right now, you're probably using several open-source tools and benefiting from them. As an open-source enthusiast, I often follow a clear and reliable method for developing and maintaining my Python repositories. In this article, I will discuss the s...1 like·178 readsPython