Metadata-Version: 2.1
Name: inline-snapshot
Version: 0.2.1
Summary: golden master/snapshot/approval testing library which puts the values right into your source code
Home-page: https://github.com/15r10nk/inline-snapshots
License: MIT
Author: Frank Hoffmann
Author-email: 15r10nk@polarbit.de
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
Requires-Dist: asttokens (>=2.0.5,<3.0.0)
Requires-Dist: black (>=23.3.0,<24.0.0)
Requires-Dist: click (>=8.1.4,<9.0.0)
Requires-Dist: executing (>=1.2.0,<2.0.0)
Project-URL: Bug Tracker, https://github.com/15r10nk/inline-snapshots/issues
Project-URL: Repository, https://github.com/15r10nk/inline-snapshots
Description-Content-Type: text/markdown

# inline-snapshot

[![Docs](https://img.shields.io/badge/docs-mkdocs-green)](https://15r10nk.github.io/inline-snapshot/)
[![pypi version](https://img.shields.io/pypi/v/inline-snapshot.svg)](https://pypi.org/project/inline-snapshot/)
![PyPI - Downloads](https://img.shields.io/pypi/dw/inline-snapshot)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/15r10nk)](https://github.com/sponsors/15r10nk)

> *create and update inline snapshots in your code.*

## Installation

You can install "inline-snapshot" via [pip](https://pypi.org/project/pip/):

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

## Usage

You can use `snapshot()` instead of the value which you want to compare with.

```python
from inline_snapshot import snapshot


def test_something():
    assert 1548 * 18489 == snapshot()
```

You can now run the tests and record the correct values.

```
$ pytest --inline-snapshot=create
```

```python
from inline_snapshot import snapshot


def test_something():
    assert 1548 * 18489 == snapshot(28620972)
```

## Features

- manage snapshots with `pytest --inline-snapshot=(create,update,fix,trim)`.
- uses `repr()` to convert the value to python code.
- values are stored in the source code and not in separate files.
- `snapshot()` supports the following operations:
  - `x == snapshot()`
  - `x <= snapshot()`
  - `x >= snapshot()`
  - `x in snapshot()`
  - `snapshot()[key]`
- code is formatted with black if the file was already formatted with black.

More information can be found in the [documentation](https://15r10nk.github.io/inline-snapshot/).

## Contributing

Contributions are very welcome.
Tests can be run with [nox](https://nox.thea.codes/en/stable/).
Please use [pre-commit](https://pre-commit.com/) for your commits.

## License

Distributed under the terms of the [MIT](http://opensource.org/licenses/MIT) license, "inline-snapshot" is free and open source software.

## Issues

If you encounter any problems, please [file an issue](https://github.com/15r10nk/inline-snapshot/issues) along with a detailed description.

