-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: explained limitations in the docs and removed pypy classifier f…
…rom pyproject.toml
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters