Skip to content

Commit

Permalink
docs: explained limitations in the docs and removed pypy classifier f…
Browse files Browse the repository at this point in the history
…rom pyproject.toml
  • Loading branch information
15r10nk committed Nov 10, 2024
1 parent d234b59 commit e94f649
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
41 changes: 41 additions & 0 deletions changelog.d/20241108_232134_15r10nk-git_fix_cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

### Removed

- removed the `"Programming Language :: Python :: Implementation :: PyPy"` classifier which was incorrect, because inline-snapshot does not work on pypy. You can use [this](https://15r10nk.github.io/inline-snapshot/limitations/#works-only-with-cpython) workaround if you want to use inline-snapshot with other implementations.


<!--
### Added
- A bullet item for the Added category.
-->
<!--
### Changed
- A bullet item for the Changed category.
-->
<!--
### Deprecated
- A bullet item for the Deprecated category.
-->
<!--
### Fixed
- A bullet item for the Fixed category.
-->
<!--
### Security
- A bullet item for the Security category.
-->
29 changes: 29 additions & 0 deletions docs/limitations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

## pytest assert rewriting is disabled

inline-snapshot must disable pytest assert-rewriting if you use report/review/create/fix/trim/update flags.

## xdist is not supported

You can not use inline-snapshot in combination with `pytest-xdist`. The use of `-n=...` implies `--inline-snapshot=disable`.

## works only with cpython

inline-snapshot works currently only with cpython. But you can work around this issue by defining a fallback snapshot function.

``` python title="my_snapshot.py"
import sys

if sys.implementation.name == "cpython":
from inline_snapshot import snapshot
else:
# This fallback allows snapshots to be used on other python implementations.
def snapshot(value):
return value
```

``` title="requirements.txt"
inline-snapshot ; implementation_name == "cpython"
```

You can then use `#!python from my_snapshot import snapshot` to run your tests with other python implementations, but you will not be able to fix the snapshot with these implementations.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ nav:
- Configuration: configuration.md
- Code generation: code_generation.md
- Testing: testing.md
- Limitations: limitations.md
- Contributing: contributing.md
- Changelog: changelog.md

Expand Down

0 comments on commit e94f649

Please sign in to comment.