pkgdocs/compare/pendulum vs pytest

Comparing

Python

pendulum

Drop-in datetime replacement with first-class timezone support, DST awareness, and intuitive arithmetic.

2.0M/ wk
v3.0.0
vs
Python

pytest

pytest: simple powerful testing with Python

0/ wk
v9.0.2
Metricpendulumpytest
EcosystemPythonPython
DifficultyBeginnerBeginner
Weekly downloads2.0M↑0
Latest versionv3.0.0v9.0.2
Recipes11

Tags

pendulum only

datetimetimezoneparsing

Shared

utilities

pytest only

testingunit-testsfixturestddpythonlibraries

When to use each

pendulum

Scheduling apps, calendar features, time-series data across timezones, any app where DST bugs would be costly.

pytest

Use pytest for any Python project with tests. It's the de facto standard — most libraries, frameworks, and CI pipelines assume pytest. Its plugin ecosystem covers everything from coverage (pytest-cov) to async tests (pytest-asyncio) to parameterisation.

When to skip each

pendulum

Simple UTC-only timestamps where datetime.now(timezone.utc) is sufficient. pendulum is heavier than stdlib.

pytest

For extremely simple one-off scripts where adding a dependency feels heavy, unittest is built into Python. For property-based testing, add Hypothesis on top of pytest rather than replacing it.

Sample recipes

pendulum

  • Work with timezones safely

pytest

  • Install pytest