diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fbae2a8..5650029a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v0.7.0 (2024-02-27) + +### Feat + +- removed old --update-snapshots option + ## v0.6.1 (2024-01-28) ### Fix diff --git a/inline_snapshot/__init__.py b/inline_snapshot/__init__.py index 8206cb32..88a4f40c 100644 --- a/inline_snapshot/__init__.py +++ b/inline_snapshot/__init__.py @@ -4,4 +4,4 @@ __all__ = ["snapshot", "external", "outsource"] -__version__ = "0.6.1" +__version__ = "0.7.0" diff --git a/inline_snapshot/pytest_plugin.py b/inline_snapshot/pytest_plugin.py index 93eb8385..af8b5f21 100644 --- a/inline_snapshot/pytest_plugin.py +++ b/inline_snapshot/pytest_plugin.py @@ -1,4 +1,3 @@ -import argparse from pathlib import Path import pytest @@ -34,16 +33,6 @@ def pytest_addoption(parser): help="disable snapshot logic", ) - # deprecated option - group.addoption( - "--update-snapshots", - action="store", - dest="inline_snapshot_deprecated", - default="none", - choices=("all", "failing", "new", "none"), - help=argparse.SUPPRESS, - ) - def pytest_configure(config): flags = config.option.inline_snapshot.split(",") @@ -58,30 +47,11 @@ def pytest_configure(config): _inline_snapshot._update_flags = _inline_snapshot.Flags(set(flags)) - old_flag = config.option.inline_snapshot_deprecated - snapshot_path = Path(config.rootpath) / ".inline-snapshot/external" _external.storage = _external.DiscStorage(snapshot_path) _config.config = _config.read_config(config.rootpath / "pyproject.toml") - if old_flag != "none": - msg_prefix = f"--update-snapshots={old_flag} is deprecated, please use " - - if _inline_snapshot._update_flags.change_something(): - raise pytest.UsageError(msg_prefix + "only --inline-snapshot") - - elif old_flag == "failing": - raise pytest.UsageError(msg_prefix + "--inline-snapshot=fix") - - elif old_flag == "new": - raise pytest.UsageError(msg_prefix + "--inline-snapshot=create") - - elif old_flag == "all": - raise pytest.UsageError(msg_prefix + "--inline-snapshot=create,fix") - else: - assert False - if _inline_snapshot._update_flags.change_something(): import sys diff --git a/pyproject.toml b/pyproject.toml index 0d6d3380..4b989ca7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ license = "MIT" name = "inline-snapshot" readme = "README.md" repository = "https://github.com/15r10nk/inline-snapshots" -version = "0.6.1" +version = "0.7.0" [tool.poetry.dependencies] asttokens = ">=2.0.5" diff --git a/tests/test_pytest_plugin.py b/tests/test_pytest_plugin.py index 96952634..fc492848 100644 --- a/tests/test_pytest_plugin.py +++ b/tests/test_pytest_plugin.py @@ -163,7 +163,7 @@ def test_a(): ) -def test_deprecated_option(project): +def test_disable_option(project): project.setup( """\ def test_a(): @@ -171,31 +171,11 @@ def test_a(): """ ) - result = project.run("--update-snapshots=failing") - assert result.stderr.str().strip() == snapshot( - "ERROR: --update-snapshots=failing is deprecated, please use --inline-snapshot=fix" - ) - - result = project.run("--update-snapshots=new") - assert result.stderr.str().strip() == snapshot( - "ERROR: --update-snapshots=new is deprecated, please use --inline-snapshot=create" - ) - - result = project.run("--update-snapshots=all") - assert result.stderr.str().strip() == snapshot( - "ERROR: --update-snapshots=all is deprecated, please use --inline-snapshot=create,fix" - ) - result = project.run("--inline-snapshot-disable", "--inline-snapshot=fix") assert result.stderr.str().strip() == snapshot( "ERROR: --inline-snapshot-disable can not be combined with other flags (fix)" ) - result = project.run("--update-snapshots=failing", "--inline-snapshot=fix") - assert result.stderr.str().strip() == snapshot( - "ERROR: --update-snapshots=failing is deprecated, please use only --inline-snapshot" - ) - def test_black_config(project): project.setup(