diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb562b..20f0f50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.0.2] - 2021-07-06 +### Fixed +- Fix specifying a different Hoverfly image +### Changed +- Bumped default Hoverfly image to 1.3.2 + ## [4.0.2] - 2021-06-11 ### Fixed - Wait until container's ports are available before considering it created diff --git a/README.md b/README.md index 4b63130..c4a6a95 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,10 @@ tell it to use Hoverfly as HTTP(S) proxy and to trust Hoverfly's certificate. Se #### How to re-record a test Add `record=True` again, and run the test. The simulation file will be overwritten. + + +#### Change Hoverfly version +To use a different Hoverfly version, specify `--hoverfly-image`. It must be a valid Docker image tag. + +#### Start Hoverfly with custom parameters +Use `--hoverfly-args`. It is passed as is to a Hoverfly container. diff --git a/pyproject.toml b/pyproject.toml index 9b45de8..2551d89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pytest_hoverfly" -version = "4.0.2" +version = "4.0.3" description = "Simplify working with Hoverfly from pytest" authors = ["Devops team at Wrike "] repository = "https://github.com/wrike/pytest-hoverfly" diff --git a/pytest_hoverfly/pytest_hoverfly.py b/pytest_hoverfly/pytest_hoverfly.py index 9e31544..f34459c 100644 --- a/pytest_hoverfly/pytest_hoverfly.py +++ b/pytest_hoverfly/pytest_hoverfly.py @@ -30,8 +30,6 @@ def __call__( *, record: bool = False, stateful: bool = False, - postprocess: t.Callable[[], t.Any], - enable_default_postprocessing: bool = True, ) -> t.Callable[..., t.Any]: ... @@ -43,7 +41,7 @@ def pytest_addoption(parser): parser.addoption( "--hoverfly-simulation-path", dest="hoverfly_simulation_path", - help="Path to a directory with simulation files. " "Environment variables will be expanded.", + help="Path to a directory with simulation files. Environment variables will be expanded.", type=Path, ) @@ -57,7 +55,7 @@ def pytest_addoption(parser): "--hoverfly-cert", dest="hoverfly_cert", default=Path(__file__).parent / "cert.pem", - help="Path to hoverfly SSL certificate. Needed " "for requests and aiohttp to trust hoverfly.", + help="Path to hoverfly SSL certificate. Needed for requests and aiohttp to trust hoverfly.", type=Path, ) @@ -150,7 +148,10 @@ def hoverfly_instance(request) -> Hoverfly: 2. Instance managed by plugin. Container will be created and destroyed after. """ - yield from get_container(create_container_kwargs={"command": request.config.option.hoverfly_args}) + yield from get_container( + create_container_kwargs={"command": request.config.option.hoverfly_args}, + image=request.config.option.hoverfly_image, + ) @pytest.fixture diff --git a/tests/test_pytest_hoverfly.py b/tests/test_pytest_hoverfly.py index 8e90130..5a0ae9a 100644 --- a/tests/test_pytest_hoverfly.py +++ b/tests/test_pytest_hoverfly.py @@ -103,6 +103,7 @@ def test_simulation_replayer(): def test_hoverfly_decorator_recorder(testdir, tmpdir): + """This test hits a network!""" # create a temporary pytest test file testdir.makepyfile( """ @@ -136,6 +137,7 @@ def test_stateful_simulation_recorder(): def test_hoverfly_decorator_stateful_recorder(testdir, tmpdir): + """This test hits a network!""" # create a temporary pytest test file testdir.makepyfile( """ @@ -183,6 +185,8 @@ def test_lack_of_unintended_side_effects(): This test must be run after at least one hoverfly-using test has been run, so that session-scoped fixtures with potential side-effects are initialized. + + This test hits a network! """ resp = requests.get("https://foaas.com/version", headers={"Accept": "application/json"})