-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: disable inline-snapshot in CI runs
- Loading branch information
Showing
9 changed files
with
125 additions
and
10 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
changelog.d/20241216_180533_15r10nk-git_disable_inline_snapshot_in_ci.md
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,48 @@ | ||
<!-- | ||
A new scriv changelog fragment. | ||
Uncomment the section that is right (remove the HTML comment wrapper). | ||
--> | ||
|
||
<!-- | ||
### Removed | ||
- A bullet item for the Removed category. | ||
--> | ||
<!-- | ||
### Added | ||
- A bullet item for the Added category. | ||
--> | ||
### Changed | ||
|
||
- inline-snapshot uses now `--inline-snapshot=disable` during CI runs by default. | ||
This improves performance because `snapshot()` is then equal to: | ||
```python | ||
def snapshot(x): | ||
return x | ||
``` | ||
|
||
|
||
|
||
|
||
<!-- | ||
### 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -485,6 +485,7 @@ def test_L2(): | |
""" | ||
} | ||
), | ||
returncode=snapshot(1), | ||
) | ||
|
||
|
||
|
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,25 @@ | ||
from inline_snapshot import snapshot | ||
from inline_snapshot.testing._example import Example | ||
|
||
|
||
def test_ci(): | ||
Example( | ||
""" | ||
from inline_snapshot import snapshot | ||
def test_something(): | ||
assert type(snapshot(5)) is int | ||
""" | ||
).run_pytest( | ||
env={"CI": "true"}, | ||
report=snapshot( | ||
"""\ | ||
INFO: CI run was detected because environment variable "CI" was defined. | ||
INFO: inline-snapshot runs with --inline-snapshot=disabled by default in CI.\ | ||
""" | ||
), | ||
).run_pytest( | ||
["--inline-snapshot=disable"], | ||
env={"CI": "true"}, | ||
report=snapshot(""), | ||
) |
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