-
-
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.
- Loading branch information
Showing
9 changed files
with
80 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
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=disabled"], 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