Metadata-Version: 2.5
Name: inline-snapshot-numpy
Version: 0.1.0
Summary: NumPy integration for inline-snapshot
Project-URL: Documentation, https://github.com/15r10nk/inline-snapshot-numpy#readme
Project-URL: Issues, https://github.com/15r10nk/inline-snapshot-numpy/issues
Project-URL: Source, https://github.com/15r10nk/inline-snapshot-numpy
Author-email: Frank Hoffmann <15r10nk@polarbit.de>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.9
Requires-Dist: inline-snapshot>=0.36.1
Requires-Dist: numpy>=1.20; python_version < '3.15'
Requires-Dist: numpy>=2.5.4; python_version >= '3.15'
Description-Content-Type: text/markdown

# inline-snapshot-numpy

[NumPy](https://numpy.org/) integration for
[inline-snapshot](https://github.com/15r10nk/inline-snapshot).

## Installation

```bash
pip install inline-snapshot-numpy
```

## Usage

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

```python
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:

```bash
pytest --inline-snapshot=create
```

The test will become:

```python
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`:

```python
from inline_snapshot_numpy import setup

setup()
```

## License

Distributed under the terms of the MIT license.
