Tag

fixture

0 views collected around this technical thread.

Test Development Learning Exchange
Test Development Learning Exchange
Nov 26, 2024 · Fundamentals

How to Encapsulate and Call Mock Services in pytest

This tutorial demonstrates how to use pytest together with Python's unittest.mock module to mock external HTTP requests, covering fixture creation, mock response setup, and writing test cases for both successful and failed API calls.

API mockingMockingfixture
0 likes · 9 min read
How to Encapsulate and Call Mock Services in pytest
Test Development Learning Exchange
Test Development Learning Exchange
Oct 9, 2024 · Backend Development

Understanding pytest Fixtures: Concepts, Scope, Dependencies, Parameterization, and Usage

This article explains pytest fixtures, covering their basic concept, definition, scope options (function, module, class, session), dependencies, parameterization, use of yield for cleanup, common usage scenarios such as data preparation, database connections, and mock objects, as well as custom markers and global registration.

fixturepytesttesting
0 likes · 7 min read
Understanding pytest Fixtures: Concepts, Scope, Dependencies, Parameterization, and Usage