Tag

unittest

0 views collected around this technical thread.

php中文网 Courses
php中文网 Courses
May 12, 2025 · Fundamentals

Python Unit Testing and Debugging Techniques: From unittest to pytest and CI Integration

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
Python Unit Testing and Debugging Techniques: From unittest to pytest and CI Integration
Test Development Learning Exchange
Test Development Learning Exchange
Feb 18, 2025 · Frontend Development

Integrating Playwright with unittest or pytest for Efficient Automated Testing

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.

AutomationCI/CDPlaywright
0 likes · 6 min read
Integrating Playwright with unittest or pytest for Efficient Automated Testing
Test Development Learning Exchange
Test Development Learning Exchange
Oct 27, 2024 · Fundamentals

Fundamental and Advanced Exception Handling in Python

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.

Exception HandlingLoggingPython
0 likes · 8 min read
Fundamental and Advanced Exception Handling in Python
Test Development Learning Exchange
Test Development Learning Exchange
Sep 14, 2024 · Fundamentals

Comprehensive Guide to Python unittest Framework

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.

AssertionsParameterized TestsPython
0 likes · 11 min read
Comprehensive Guide to Python unittest Framework
Test Development Learning Exchange
Test Development Learning Exchange
Aug 19, 2024 · Fundamentals

Applying Python Magic Methods in Unit Tests: __init__, setUp, tearDown, __str__, __repr__, __eq__, __lt__, __len__, __iter__, __getitem__

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 MethodsPython
0 likes · 7 min read
Applying Python Magic Methods in Unit Tests: __init__, setUp, tearDown, __str__, __repr__, __eq__, __lt__, __len__, __iter__, __getitem__
Test Development Learning Exchange
Test Development Learning Exchange
Aug 12, 2024 · Fundamentals

Comprehensive Guide to Python unittest Features and Advanced Testing Techniques

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.

AssertionsDecoratorsPython
0 likes · 10 min read
Comprehensive Guide to Python unittest Features and Advanced Testing Techniques
Test Development Learning Exchange
Test Development Learning Exchange
Jul 22, 2024 · Backend Development

Python API Testing Examples Using requests, unittest, pytest, and jsonschema

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 testingRequestsjsonschema
0 likes · 6 min read
Python API Testing Examples Using requests, unittest, pytest, and jsonschema
Test Development Learning Exchange
Test Development Learning Exchange
Jul 19, 2024 · Backend Development

Using Test Tags in Python unittest and pytest for Efficient Test Management

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.

Automation Testingpytesttest tags
0 likes · 6 min read
Using Test Tags in Python unittest and pytest for Efficient Test Management
Test Development Learning Exchange
Test Development Learning Exchange
Jul 19, 2024 · Fundamentals

Ten Ways to Handle Dynamic Parameters in Python API Automation Testing

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 testingAutomationDynamic Parameters
0 likes · 5 min read
Ten Ways to Handle Dynamic Parameters in Python API Automation Testing
Test Development Learning Exchange
Test Development Learning Exchange
Jul 5, 2024 · Fundamentals

From Functional Testing to Automated Testing: A Python‑Based Learning Roadmap

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/CDPythonSelenium
0 likes · 6 min read
From Functional Testing to Automated Testing: A Python‑Based Learning Roadmap
Test Development Learning Exchange
Test Development Learning Exchange
Jun 6, 2024 · Fundamentals

Advanced Techniques for Dynamically Generating Unit Tests in Python

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
Advanced Techniques for Dynamically Generating Unit Tests in Python
Test Development Learning Exchange
Test Development Learning Exchange
Jun 5, 2024 · Fundamentals

Understanding unittest.TestLoader in Python: 11 Key Features and Usage

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.

PythonTestLoaderTesting Automation
0 likes · 4 min read
Understanding unittest.TestLoader in Python: 11 Key Features and Usage
Go Programming World
Go Programming World
May 11, 2024 · Backend Development

Testing HTTP Applications in Go: Isolating External Dependencies

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.

GoGockHTTP
0 likes · 21 min read
Testing HTTP Applications in Go: Isolating External Dependencies
Test Development Learning Exchange
Test Development Learning Exchange
Apr 11, 2024 · Fundamentals

Allure-Python: Generating Rich Test Reports for Python Testing Frameworks

Allure-Python is a reporting tool for Python test frameworks such as unittest, pytest, and nose, providing customizable, interactive HTML reports with support for decorators, steps, attachments, environment data, and advanced features to enhance test visibility and analysis.

AllureAutomationPython
0 likes · 7 min read
Allure-Python: Generating Rich Test Reports for Python Testing Frameworks
Test Development Learning Exchange
Test Development Learning Exchange
Feb 18, 2024 · Backend Development

Dynamic Environment Switching in Test Frameworks Using Python Decorators

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/CDPythondecorator
0 likes · 9 min read
Dynamic Environment Switching in Test Frameworks Using Python Decorators
Test Development Learning Exchange
Test Development Learning Exchange
Feb 12, 2024 · Frontend Development

Data-Driven Testing with Playwright and openpyxl in Python

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.

AutomationData-Driven TestingPlaywright
0 likes · 3 min read
Data-Driven Testing with Playwright and openpyxl in Python
Test Development Learning Exchange
Test Development Learning Exchange
Dec 31, 2023 · Backend Development

Comprehensive Guide to Python Testing Libraries and Utilities for API Development

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.

APIMockPerformance
0 likes · 7 min read
Comprehensive Guide to Python Testing Libraries and Utilities for API Development
Test Development Learning Exchange
Test Development Learning Exchange
Nov 9, 2023 · Backend Development

10 Common Python Automation Testing Scripts for API Testing

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.

API testingAutomation TestingData Generation
0 likes · 7 min read
10 Common Python Automation Testing Scripts for API Testing
Python Programming Learning Circle
Python Programming Learning Circle
Oct 31, 2023 · Fundamentals

Comparison of Five Python Automation Testing Frameworks: Robot Framework, Pytest, UnitTest, Behave, and Lettuce

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.

AutomationLettucebehave
0 likes · 14 min read
Comparison of Five Python Automation Testing Frameworks: Robot Framework, Pytest, UnitTest, Behave, and Lettuce
360 Quality & Efficiency
360 Quality & Efficiency
Jul 14, 2023 · Backend Development

Quick Guide to Generating Clear HTML Test Reports with unittestreport

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.

AutomationPythonhtml-report
0 likes · 8 min read
Quick Guide to Generating Clear HTML Test Reports with unittestreport