Skip to content

Commit

Permalink
Make Container inherit from ParameterSet
Browse files Browse the repository at this point in the history
  • Loading branch information
dcermak committed Jan 14, 2025
1 parent 7013037 commit 89b9016
Show file tree
Hide file tree
Showing 9 changed files with 369 additions and 141 deletions.
26 changes: 20 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,20 @@ Breaking changes:
the runtime is not functional (`gh#238
<https://github.com/dcermak/pytest_container/pull/238>`_)

- Remove intermediate class ``container.ContainerBaseABC``

- :py:class:`~pytest_container.container.Container` and
:py:class:`~pytest_container.container.DerivedContainer` are no longer
dataclasses

Improvements and new features:

- :py:class:`~pytest_container.container.Container` and
:py:class:`~pytest_container.container.DerivedContainer` now inherit from
``pytest``'s ``ParameterSet`` and can thus be directly used for test
parametrization including
marks. :py:class:`~pytest_container.container.DerivedContainer` also inherits
all marks from the base containers.

Documentation:

Expand Down Expand Up @@ -97,16 +109,18 @@ Internal changes:
Breaking changes:

- add the parameter ``container_runtime`` to
:py:func:`~pytest_container.container.ContainerBaseABC.prepare_container` and
:py:func:`~pytest_container.container.ContainerBase.prepare_container` (was
``ContainerBaseABC.prepare_container``) and
:py:func:`~pytest_container.build.MultiStageBuild.prepare_build`.

- deprecate the function ``pytest_container.container_from_pytest_param``,
please use
:py:func:`~pytest_container.container.container_and_marks_from_pytest_param`
instead.

- :py:func:`~pytest_container.container.ContainerBaseABC.get_base` no longer
returns the recursive base but the immediate base.
- :py:func:`~pytest_container.container.ContainerBase.get_base` (was
``ContainerBaseABC.get_base``) no longer returns the recursive base but the
immediate base.


Improvements and new features:
Expand Down Expand Up @@ -153,9 +167,9 @@ Breaking changes:

Improvements and new features:

- Add :py:attr:`~pytest_container.container.ContainerBaseABC.baseurl` property
to get the registry url of the container on which any currently existing
container is based on.
- Add :py:attr:`~pytest_container.container.ContainerBase.baseurl` (was
``ContainerBaseABC.baseurl``) property to get the registry url of the
container on which any currently existing container is based on.


Documentation:
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,12 @@ ignore = [
[tool.ruff.lint.isort]
force-single-line = true
case-sensitive = true

[tool.pytest.ini_options]
xfail_strict = true
addopts = "--strict-markers"
markers = [
'secretleapmark',
'othersecretmark',
'secretpodmark',
]
Loading

0 comments on commit 89b9016

Please sign in to comment.