class documentation

class VerifyPyprojectDotTomlTests(TestCase):

View In Hierarchy

Test the `_load_pyproject_toml` helper function

Method test_brokenToml Syntactially invalid TOML produces an exception. The specific exception varies by the underlying TOML library.
Method test_fileNotFound An absent ``pyproject.toml`` file produces no result unless there is opt-in.
Method test_nameInvalidOptIn `TypeError` is raised when the project name isn't a string.
Method test_nameMissing `ValueError` is raised when we can't extract the project name.
Method test_noToolIncrementalSection The ``[tool.incremental]`` table is not strictly required, but its ``opt_in=False`` indicates its absence.
Method test_packagePathRequired Raise `ValueError` when the package root can't be resolved.
Method test_setuptoolsOptIn The package has opted-in to Incremental version management when the ``[tool.incremental]`` section is a dict. The project name is taken from ``[tool.incremental] name`` or ``[project] name``.
Method test_toolIncrementalInvalid `ValueError` is raised when the ``[tool]`` or ``[tool.incremental]`` isn't a table.
Method test_toolIncrementalUnexpecteKeys Raise `ValueError` when the ``[tool.incremental]`` section contains keys other than ``"name"``
Method _loadToml Read a TOML snipped from a temporary file with `_load_pyproject_toml`
def test_brokenToml(self):

Syntactially invalid TOML produces an exception. The specific exception varies by the underlying TOML library.

def test_fileNotFound(self):

An absent ``pyproject.toml`` file produces no result unless there is opt-in.

def test_nameInvalidOptIn(self):

`TypeError` is raised when the project name isn't a string.

def test_nameMissing(self):

`ValueError` is raised when we can't extract the project name.

def test_noToolIncrementalSection(self):

The ``[tool.incremental]`` table is not strictly required, but its ``opt_in=False`` indicates its absence.

def test_packagePathRequired(self):

Raise `ValueError` when the package root can't be resolved.

def test_setuptoolsOptIn(self):

The package has opted-in to Incremental version management when the ``[tool.incremental]`` section is a dict. The project name is taken from ``[tool.incremental] name`` or ``[project] name``.

def test_toolIncrementalInvalid(self):

`ValueError` is raised when the ``[tool]`` or ``[tool.incremental]`` isn't a table.

def test_toolIncrementalUnexpecteKeys(self):

Raise `ValueError` when the ``[tool.incremental]`` section contains keys other than ``"name"``

def _loadToml(self, toml: str, *, path: Path | str | None = None) -> _IncrementalConfig | None:

Read a TOML snipped from a temporary file with `_load_pyproject_toml`

Parameters
toml:strTOML content of the temporary file
path:Path | str | NonePath to which the TOML is written
Returns
_IncrementalConfig | NoneUndocumented