Tagged articles
unittest
48 articles · Page 1 of 1
This tutorial demonstrates building a complete registration and login platform using WorkBuddy AI without writing code, covering UI prototyping, validation rules, SHA256 password hashing, CSRF protection, and both GUI (Playwright POM) and API (requests+unittest) test suites with all 157 tests passing.
API testingCSRF protectionPOM pattern
0 likes · 8 min read

After parallelizing registration, login, and password‑recovery flows, this article shows how to embed those requirements into a reusable intelligent agent, detailing the workflow diagram, system and user prompts, and providing concrete Python‑based API and Playwright test script examples with CSRF handling, password hashing, and database cleanup.
AI TestingAPI testingCSRF
0 likes · 38 min read

Mastering debugging in Python boosts development efficiency, and this guide walks you through ten practical techniques—from using the built-in pdb and breakpoint() to leveraging logging, assertions, warnings, IDE tools, and unit testing—complete with code examples and actionable tips for developers of all levels.
PDBdebuggingunittest
0 likes · 8 min read

This article introduces the most frequently used decorators in Python's unittest and pytest frameworks, demonstrates generic class and custom decorators, and shows how to apply Flask testing decorators for web API testing, all with clear code examples.
Python testingdecoratorsflask testing
0 likes · 6 min read

This article explains why unit testing and debugging are essential in Python development, introduces the unittest and pytest frameworks, shows how to measure test coverage, demonstrates debugging methods like print statements, pdb, and IDE tools, and provides examples of integrating tests into CI pipelines.
CI/CDPythondebugging
0 likes · 10 min read

This article explains how to combine Playwright with Python's unittest or pytest frameworks to build robust test suites, design data‑driven tests, run tests in parallel or distributed environments, and integrate the workflow into CI/CD pipelines such as GitHub Actions and Jenkins.
CI/CDPlaywrightPython
0 likes · 6 min read

This article presents a comprehensive guide to Python exception handling, covering basic try‑except usage, multiple exception capture, else/finally clauses, custom exceptions, exception chaining, logging, context managers, assertions, traceback, concurrent and asynchronous error handling, and testing techniques.
ConcurrencyLoggingasyncio
0 likes · 8 min read

This article provides a detailed tutorial on Python's unittest framework, covering basic concepts, assertion methods, test suites, setup and teardown, parameterized tests, test organization, and includes extensive code examples demonstrating how to write and run unit tests effectively.
Test Automationassertionsparameterized tests
0 likes · 11 min read

This guide walks through Python's unittest module, covering fundamental concepts, test suites, loaders, custom result handling, skipping tests, retry decorators, execution order, tagging, class-level setup/teardown, and exception‑message assertions, each illustrated with clear code examples.
RetryassertRaisesRegexcustom result
0 likes · 8 min read

This article explains how Python's magic (special) methods such as __init__, setUp, tearDown, __str__, __repr__, __eq__, __lt__, __len__, __iter__, and __getitem__ can be leveraged within unittest test cases to customize initialization, setup, cleanup, representation, comparison, length, iteration, and indexing, accompanied by concrete code examples.
code-examplesmagic-methodsunittest
0 likes · 7 min read

This article presents a detailed overview of Python's unittest framework, covering test suites, decorators, parameterized tests, nested tests, dynamic test generation, loaders, exception assertions, subtests, setup/teardown, various assertion methods, test skipping, output capturing, asynchronous testing, and custom assertions, each illustrated with clear code examples.
PythonTest Suitesassertions
0 likes · 10 min read

This article provides a series of Python code examples demonstrating how to perform API automation testing tasks—including GET and POST requests, authentication, file uploads, redirects, unit testing with unittest and pytest, response mocking with responses, and response schema validation with jsonschema—offering practical guidance for backend testing.
API testingPythonjsonschema
0 likes · 6 min read

This article explains how to apply test tags in Python's unittest and pytest frameworks, providing multiple code examples that demonstrate custom attributes, class-level tags, markers, multi‑tags, parameterized tests, dynamic tagging, custom plugins, and report customization to improve test selection and organization in large automation suites.
pytesttest tagsunittest
0 likes · 6 min read

This article demonstrates ten practical methods for handling dynamic parameters in Python API automation testing, covering dictionaries, loops, pytest parametrization, fixtures, unittest, decorators, generators, class attributes, reflection, and external data sources like CSV.
API testingPythonautomation
0 likes · 5 min read

This article guides functional testers on transitioning to automated testing with Python, covering core concepts, a step‑by‑step learning plan, and ten practical code snippets ranging from unittest and pytest to Selenium web and API automation.
CI/CDPythonautomated testing
0 likes · 6 min read

This article presents ten Python unittest strategies—including list comprehensions, metaclasses, the parameterized library, file‑driven data, factory functions, TestLoader/TestSuite, subTest, database‑driven cases, pytest parametrize, and YAML/INI configuration—to create flexible, data‑driven unit tests efficiently.
dynamic testsparameterizedtesting
0 likes · 7 min read

The article explains the purpose and functionality of Python’s unittest.TestLoader class, detailing its default behavior, discovery method, various loading functions, sorting options, customizable attributes, and how subclassing can tailor test loading for more flexible and efficient test organization.
PythonTestLoadertest discovery
0 likes · 4 min read

This article explains how to write reliable unit tests for Go HTTP applications by isolating external dependencies, covering server‑side handlers, client‑side monitoring, and using tools such as net/http/httptest, testify, and gock to create test doubles and mock HTTP services.
GoHTTPgock
0 likes · 21 min read

The article explains the importance of dynamic environment switching in testing frameworks for multi‑environment validation, resource isolation, debugging, and CI/CD, and provides Python unittest decorator examples along with best‑practice considerations such as scope, thread safety, resource management, and execution order.
CI/CDDecoratorPython
0 likes · 9 min read

This tutorial explains how to perform data‑driven testing by installing Playwright, reading test data from Excel with openpyxl, simulating user actions, and writing reusable unittest test cases that drive browser interactions based on external data.
PlaywrightPythonautomation
0 likes · 3 min read

This article presents a detailed overview of Python testing tools—including requests, unittest, pytest, mocking libraries, performance measurement plugins, and data generation utilities—illustrating how to write, run, and validate API tests with code examples and best‑practice explanations.
Mockperformancepytest
0 likes · 7 min read

This article presents ten practical Python automation testing scripts—including batch test execution, data‑driven testing, API monitoring, performance measurement, database checks, screenshot capture, email reporting, data generation, logging, and response validation—to help developers streamline API testing and improve efficiency.
Automation TestingData GenerationLogging
0 likes · 7 min read

This article reviews and compares five popular Python automation testing frameworks—Robot Framework, Pytest, UnitTest, Behave, and Lettuce—covering their prerequisites, advantages, disadvantages, and how they stack up against each other to help newcomers choose the right tool for functional, unit, or behavior‑driven testing.
LettucePythonautomation
0 likes · 14 min read

This article introduces the open‑source unittestreport framework for Python, explains how to install it, configure report parameters, use multi‑threaded execution, enable email notifications, and extend it with HTMLTestRunner compatibility to produce customizable, visual HTML test reports for unittest and pytest projects.
HTML reportpytesttesting
0 likes · 8 min read

This article explains how the Python libraries requests and xlwt can be combined to build a flexible API automation testing framework that reads test cases from Excel, executes HTTP requests, validates responses, and writes test results back to Excel files.
Pythonautomationunittest
0 likes · 9 min read

This article explains how to leverage Python's requests library for sending HTTP requests and xlwt for exporting test results to Excel, providing a complete example of an API automation testing framework that reads test cases from Excel, runs them with unittest, and generates a report.
api-testingunittestxlwt
0 likes · 9 min read

This article explains how to use Python's unittest and pytest frameworks to create automated test cases, build test suites, and explicitly control the execution order of tests, providing code examples and a summary of best practices for effective test management.
automated testingpytesttest ordering
0 likes · 4 min read

This article explains how to quickly generate clear, visual HTML test reports using the unittestreport framework, covering installation, basic usage, data‑driven testing, multithreading, email notifications, SSL fixes, and compatibility extensions with HTMLTestRunner for both unittest and pytest environments.
HTML test reportPython testingpytest
0 likes · 8 min read


21CTOMar 28, 2023 · Backend Development
This article evaluates the five leading Python test automation frameworks—Robot Framework, Pytest, unittest (PyUnit), Behave, and Lettuce—detailing their installation requirements, key features, advantages, disadvantages, and suitability for functional, unit, or behavior‑driven testing to help developers choose the right tool.
LettucePythonTest Automation
0 likes · 12 min read

The article examines the limitations of unittest's assertEqual for validating hundreds of CSV metrics, proposes method-splitting, custom checkpoint classes, and pytest‑assume techniques to allow multiple assertions to run and report failures without halting the entire test suite.
assertionpytesttesting
0 likes · 5 min read

The author recounts their progression from beginner Selenium script recording to mastering WebDriver element location and a UnitTest‑based automation framework, highlighting challenges like script failures, code redundancy, and real‑world problem solving, and emphasizes continuous learning for effective Python automation testing.
Pythonseleniumtest framework
0 likes · 6 min read

This article provides a comprehensive guide to Pytest, covering basic test case creation, exception handling, test classes, automatic test discovery, advanced features like parametrize, marks, fixtures, and plugin/hook development, complete with practical code examples and configuration tips.
fixturesparametrizeplugins
0 likes · 8 min read

This article walks through three frequent Selenium‑Python automation problems—missing test discovery due to method naming, incorrect URLs that break page data loading, and element‑location failures after window switches—explaining their causes and step‑by‑step solutions.
Pythonautomated testingdebugging
0 likes · 7 min read

The article explains how to automatically generate separate unittest test cases for each combination of input parameters by using setattr and static methods, avoiding large monolithic tests and enabling clear result reporting, and provides a complete Python code example.
Pythondynamic test generationtesting
0 likes · 4 min read

This article details the step‑by‑step creation of a Python‑based API automation testing framework, covering project structure, configuration files, a reusable logging module, HTTP request handling with requests, common utilities for Excel and XML, MySQL database access, email reporting, and the test runner setup.
API testingLoggingMySQL
0 likes · 20 min read

This article introduces Python’s built‑in unittest framework, explains its core concepts such as test cases, fixtures, suites and runners, demonstrates common assertion methods, and provides a step‑by‑step Selenium example for testing a webmail login flow.
PythonTest AutomationTesting Framework
0 likes · 9 min read

Learn the core principles for writing effective unit tests—such as focusing on single functions, ensuring independence, and using descriptive names—alongside a concise overview of popular Python testing tools like unittest, pytest, nose, doctest, tox, and mock, to boost code reliability.
Pythonpytestsoftware quality
0 likes · 5 min read

This article reviews five popular Python automation testing frameworks—Robot Framework, Pytest, UnitTest/PyUnit, Behave, and Lettuce—detailing their prerequisites, strengths, weaknesses, and how they compare, to help developers select the most suitable tool for their projects.
Lettuceautomationbehave
0 likes · 13 min read

This article explains how to measure Python code coverage using the Coverage tool, covering installation, command‑line and API usage, and provides a complete example with a simple function, unit tests, and generated HTML reports to visualize covered and missed statements.
code coveragecoverage tooltesting
0 likes · 6 min read

This article compares three popular Python test automation frameworks—Robot Framework, pytest, and unittest—detailing their prerequisites, key advantages, drawbacks, and ideal use cases to help developers choose the most suitable tool for their testing needs.
PythonTest Automationcomparison
0 likes · 10 min read

This article introduces Python’s built‑in unittest framework, outlining its lightweight advantages, core components such as TestCase, TestSuite, TestRunner and TestLoader, and demonstrates a complete automation workflow from Excel‑based test data preparation to generating HTML test reports with HTMLTestRunnerNew.
PythonTest Automationsoftware testing
0 likes · 4 min read

This article explains how to combine Python's unittest framework with the third‑party ddt library to create data‑driven tests, covering test fixtures, decorators, data handling techniques, and examples of loading test data from JSON, YAML, CSV, or Excel files.
Data‑Driven TestingPythonddt
0 likes · 3 min read

This article explains interface Diff testing—comparing API responses across versions or environments—covers its benefits, outlines the implementation approach with project structure, test case organization, and BeautifulReport integration, and provides practical tips for Python developers to automate comprehensive API validation.
API testingBeautifulReportPython
0 likes · 6 min read

This article explains how interface diff testing compares API responses across versions or environments using automated replay of production logs, outlines the project structure, demonstrates unittest‑based implementation with JSON recursive comparison, and shows how to generate clear HTML reports with BeautifulReport.
API testingBeautifulReportautomation
0 likes · 6 min read

This article introduces Python's built‑in unittest framework, explains core concepts such as TestCase, TestSuite, TestLoader, and TestRunner, demonstrates how to write test cases, generate HTML and XML reports with HTMLTestRunner and xmlrunner, and shows parameterized testing with nose‑parameterized for CI pipelines.
CIHTMLTestRunnerPython
0 likes · 7 min read

This article introduces a lightweight Python unittest‑based API automation testing framework, outlines its directory structure and configuration files, and provides a brief walkthrough of each component such as config, MySQL, Redis, logging, email utilities, QR code generation, and test runner scripts.
API testingPythonframework
0 likes · 2 min read

This article guides readers through setting up a Python environment, installing BeautifulReport, organizing test projects, and combining unittest with multithreading to produce a single, polished HTML test report while addressing common pitfalls and configuration issues.
BeautifulReportMultithreadingTest Automation
0 likes · 5 min read

This article explains what the Python Mock library does, how to install and import it, demonstrates basic and advanced usage including creating mock objects, setting return values and side effects, and shows how to apply patch and patch.object for effective unit testing without a real server.
Mockpatchunit-testing
0 likes · 12 min read
