-
-
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.
fix: support pypy, but only --inline-snapshot=disable
- Loading branch information
Showing
10 changed files
with
134 additions
and
7 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
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,43 @@ | ||
<!-- | ||
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 can not fix snapshots on pypy. | ||
inline-snapshot enforces now `--inline-snapshot=disable` if it is used with any other implementation than cpython, which allows it to be used in packages which want to support pypy. | ||
|
||
|
||
|
||
<!-- | ||
### 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
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
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
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
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
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
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,40 @@ | ||
import sys | ||
|
||
import pytest | ||
from inline_snapshot import snapshot | ||
from inline_snapshot.testing import Example | ||
|
||
|
||
@pytest.mark.no_rewriting | ||
def test_pypy(): | ||
report = ( | ||
snapshot("INFO: inline-snapshot was disabled because pypy is not supported") | ||
if sys.implementation.name == "pypy" | ||
else snapshot( | ||
"""\ | ||
-------------------------------- Fix snapshots --------------------------------- | ||
+----------------------------- test_something.py ------------------------------+ | ||
| @@ -1,6 +1,6 @@ | | ||
| | | ||
| from inline_snapshot import snapshot | | ||
| | | ||
| def test_example(): | | ||
| - assert 1+1==snapshot(3) | | ||
| + assert 1+1==snapshot(2) | | ||
+------------------------------------------------------------------------------+ | ||
These changes will be applied, because you used --inline-snapshot=fix\ | ||
""" | ||
) | ||
) | ||
|
||
Example( | ||
"""\ | ||
from inline_snapshot import snapshot | ||
def test_example(): | ||
assert 1+1==snapshot(3) | ||
""" | ||
).run_pytest(["--inline-snapshot=fix"], report=report).run_pytest( | ||
["--inline-snapshot=disable"], report="" | ||
) |
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