Skip to content

Commit 97d0328

Browse files
authored
docs: add snapshot extension cli option and defaults (#145)
* docs: add snapshot extension option and defaults * cr: wording
1 parent 7ab5250 commit 97d0328

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ def __repr__(self) -> str:
7575

7676
These are the cli options exposed to `pytest` by the plugin.
7777

78-
| Option | Description |
79-
| ------------------------ | -------------------------------------------------------------------------------------- |
80-
| `--snapshot-update` | Snapshots will be updated to match assertions and unused snapshots will be deleted. |
81-
| `--snapshot-warn-unused` | Prints a warning on unused snapshots rather than fail the test suite. |
78+
| Option | Description | Default |
79+
| ------------------------------ | ----------------------------------------------------------------------------------- | ------------------------------------------------ |
80+
| `--snapshot-update` | Snapshots will be updated to match assertions and unused snapshots will be deleted. | `False` |
81+
| `--snapshot-warn-unused` | Prints a warning on unused snapshots rather than fail the test suite. | `False` |
82+
| `--snapshot-default-extension` | Use to change the default snapshot extension class. | `syrupy.extensions.amber.AmberSnapshotExtension` |
8283

8384
### Built-In Extensions
8485

tests/test_integration_default.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_unused_snapshots_ignored_if_not_targeted_using_dash_m(collection, snaps
4848
def test_collected(snapshot, actual):
4949
assert snapshot == actual
5050
"""
51-
)
51+
),
5252
}
5353
collection.makepyfile(**updated_tests)
5454
result = collection.runpytest("-v", "--snapshot-update", "-m", "parametrize")
@@ -90,7 +90,7 @@ def test_unused_parameterized_ignored_if_not_targeted_using_dash_k(
9090
def test_collected(snapshot, actual):
9191
assert snapshot == actual
9292
"""
93-
)
93+
),
9494
}
9595
collection.makepyfile(**updated_tests)
9696
result = collection.runpytest("-v", "--snapshot-update", "-k", "test_collected[")
@@ -312,7 +312,7 @@ def test_unused_snapshots_cleaned_up_when_targeting_specific_testfiles(stubs, sn
312312
def test_used(snapshot):
313313
assert True
314314
"""
315-
)
315+
),
316316
)
317317
testdir.makefile(".ambr", **{"__snapshots__/other_snapfile": ""})
318318
result = testdir.runpytest("-v", "--snapshot-update", "test_file.py")
@@ -376,7 +376,7 @@ def test_snapshot_default_extension_option(testdir, snapshot):
376376
def test_default(snapshot):
377377
assert b"default extension serializer" == snapshot
378378
"""
379-
)
379+
),
380380
)
381381
result = testdir.runpytest(
382382
"-v",

0 commit comments

Comments
 (0)