Skip to main content

inline-snapshot-numpy

NumPy integration for inline-snapshot.

Installation

pip install inline-snapshot-numpy

Usage

The package provides snapshot-aware versions of NumPy's array assertions:

from inline_snapshot_numpy import assert_array_equal
from numpy import array


def test_array():
    actual = array([[1, 2], [3, 4]])
    assert_array_equal(actual)

Create the missing snapshot with:

pytest --inline-snapshot=create

The test will become:

def test_array():
    actual = array([[1, 2], [3, 4]])
    assert_array_equal(actual, desired=array([[1, 2], [3, 4]]))

The following helpers are available: assert_array_equal, assert_allclose, assert_array_almost_equal, assert_array_almost_equal_nulp, and assert_array_max_ulp.

The expected array is managed through snapshot_arg(), so no explicit snapshot() call or import is needed. You can still pass an explicit snapshot(...) for compatibility.

Alternatively, call setup() from conftest.py to patch the corresponding functions in numpy.testing:

from inline_snapshot_numpy import setup

setup()

License

Distributed under the terms of the MIT license.

Metadata

Release files for inline-snapshot-numpy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inline-snapshot-numpy 0.1.0
File Size Uploaded Provenance Actions
inline_snapshot_numpy-0.1.0.tar.gz 148.5 kB Without provenance Details for inline_snapshot_numpy-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for inline-snapshot-numpy 0.1.0
File Interpreter ABI Platform Actions
inline_snapshot_numpy-0.1.0-py3-none-any.whl Python 3 none any Details for inline_snapshot_numpy-0.1.0-py3-none-any.whl

Total release size: 152.5 kB

Release files / inline_snapshot_numpy-0.1.0.tar.gz

Download URL inline_snapshot_numpy-0.1.0.tar.gz
Size 148.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1c9f46cf6a0dc5eb9e347f4e4628aa1ec6f02d542c529f3d2b1bb7d0a9dd3021
BLAKE2b-256 checksum
How to use checksums
44ea3cb1f3860d84b718425a25d7ce8d70c485878bf92530ed3d60fafc43b909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.0.6","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / inline_snapshot_numpy-0.1.0-py3-none-any.whl

Download URL inline_snapshot_numpy-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2d34ba037ecef1ef37fd75a78f5db63e7024da065c487a3aab150b77b00d4ca
BLAKE2b-256 checksum
How to use checksums
d2aa0784fdf1a01487f072bbaa9af2937b0b16a4010310a20b4fed2532c167ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.0.6","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for inline-snapshot-numpy 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page