In the dim glow of my computer screen, after hours of wrestling with a
particularly stubborn bug, it finally happened. The lines of code
aligned, the program ran seamlessly, and I felt that rush of triumph.
Join me as I revisit these eureka moments and unravel the mysteries
behind the code.
I write about my experiences and journey as a software developer,
about coding topics that I've struggled with in the hopes that you
don't have to, and about things I've learned that I think are awesome.
This space is a melting pot of tutorials, discussions on tools, and
explorations of intriguing software development concepts. Enjoy!
Parameterization is a powerful tool in pytest (the most popular Python testing framework). It allows us to write a single, simple test that can dynamically expand to become many similar tests with minor input differences. In this blog post, I will describe how to write parameterized pytests and why they are such a powerful tool. And then, I’ll show you how to re-write parameterized tests more effectively using dataclasses.
We all know testing our code is important, right? Automated tests can give peace of mind that our code is working as expected and that it continues to work as expected, even as it is refactored. Python has the pytest framework that offers great tools for testing our backend python code. You can check out my blog post, 9 pytest tips and tricks to take your tests to the next level, to get yourself jump-started testing in python. And javascript has several libraries to test front-end code. But in website testing, how can we write automated tests to ensure that our back-end code (be it python or something else) is working with our front-end code (javascript, HTML, and CSS)?
Introducing Playwright, a fast, easy-to-use, and powerful end-to-end browser automation framework. Similar to the Selenium framework, the Playwright framework has tools that allow us to write tests and scripts that act similar to an actual, human website user. And Playwright has API endpoints in javascript, java, .NET, and python! Sound useful? Read on as we use Playwright with python and pytest to write scripts and end-to-end tests for our Connect 4 game web page.
Are you a python developer looking to improve your testing abilities with
pytest? Me too! So I’ve put together a list of 9 tips and tricks I’ve
found most useful in getting my tests looking sharp. Here are the features
we’re going to be covering today: