Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,965 guides across 14 topics

Topics

Latest guides

Illustration of a pytest.raises context block catching a raised exception during Python unit testing.
Python

Python Pytest Exception Testing with pytest.raises

Use pytest.raises to assert exception types and messages in Python: inspect raised exceptions, parametrize test cases, and avoid common mistakes.

pytestexception testingunit testingerror handling
A visual representation of pytest markers controlling test execution with skip, skipif, and xfail conditions.
Python

Python pytest marks: skip, skipif, and xfail

Use pytest's skip, skipif, and xfail markers to control test execution: skip a test unconditionally, skip when a condition is true, or mark a failing test as expected.

pytesttest skippingxfailconditional tests
A Python test function decorated with pytest.mark.parametrize, showing multiple input sets feeding into a single test.
Python

Using pytest.mark.parametrize for Parameterized Tests in Python

Learn how to use pytest.mark.parametrize to write parameterized tests in Python. Covers syntax, multiple arguments, fixtures, custom IDs, class/module-level use, and common pitfalls.

pytestparameterized testingpython testingtest parametrization
Diagram showing pytest fixture scopes from function to session and conftest sharing fixtures across test files.
Python

Python Pytest Fixtures Scope and conftest

Learn how pytest fixture scope controls setup frequency and how conftest.py shares fixtures across test files, including when widening scope is safe.

pytestfixturesconftesttest-scopes
A pytest test file with assert statements being collected and run by the pytest runner.
Python

Python Pytest: Basic Tests, Assertions, and Test Discovery

Learn how to write basic pytest tests with plain assert statements, understand pytest test discovery rules, test exceptions and floating-point values, and run a subset of tests.

pytestpython testingassertionstest discovery
Comparison of Celery and APScheduler for Python task scheduling, showing distributed queue vs in-process scheduler.
Python

Python Celery vs APScheduler: Choosing the Right Task Scheduler

Compare Celery and APScheduler for Python background tasks: architecture, scheduling, reliability, scaling, and when to choose each.

CeleryAPSchedulerTask QueueBackground Tasks
Diagram showing Celery task queue connecting FastAPI and Django applications to a worker and result backend.
Python

Using Python Celery with FastAPI and Django

Integrate Celery with FastAPI and Django: configure a shared Celery app, define reusable tasks, call tasks from views and endpoints, and handle results, errors, and monitoring.

CeleryFastAPIDjangoBackground Tasks
Illustration of a Celery worker applying a rate limit to a queue of tasks, with a token bucket controlling task execution.
Python

Python Celery Rate Limits: Syntax and Worker Behavior

Configure Python Celery rate limits on tasks, read the rate-limit string syntax, and understand how each worker instance enforces limits.

CeleryRate LimitingTask QueuesWorker Configuration
Illustration of Celery workflow primitives: a chain of tasks, a group of parallel tasks, and a chord combining them with a callback.
Python

Python Celery Chains, Groups, and Chords Explained

python celery chains groups and chords: Learn how to compose Celery tasks into sequential chains, parallel groups, and chords that trigger callbacks after parallel wor...

CeleryTask OrchestrationDistributed TasksWorkflow Composition
A diagram showing a Celery Beat scheduler sending periodic task messages to a broker, which workers consume.
Python

Python Celery Beat and Periodic Tasks

Set up Celery Beat for periodic tasks in Python: interval and crontab schedules, timezone and duplicate-execution pitfalls, and running the scheduler reliably.

CeleryTask SchedulingPeriodic TasksPython