Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 686ce67

Browse filesBrowse files
committed
se #doctest: +SKIP to avoid OrderedDict result
The OrderedDict.__repr__ method was changed in Python 3.12 to output a different string than before (see #418 for details). The respective doctests which show the output was marked as "skipped" with the above directive. We keep the test for documentation purpuses. In the test tests/test_semver.py::test_should_versioninfo_to_dict we test the keys and values separately.
1 parent a34e218 commit 686ce67
Copy full SHA for 686ce67

File tree

4 files changed

+4
-3
lines changed
Filter options

4 files changed

+4
-3
lines changed

‎docs/usage/convert-version-into-different-types.rst

Copy file name to clipboardExpand all lines: docs/usage/convert-version-into-different-types.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ It is possible to convert a :class:`~semver.version.Version` instance:
1616
* Into a dictionary with :meth:`~semver.version.Version.to_dict`::
1717

1818
>>> v = Version(major=3, minor=4, patch=5)
19-
>>> v.to_dict()
19+
>>> v.to_dict() #doctest: +SKIP
2020
OrderedDict({'major': 3, 'minor': 4, 'patch': 5, 'prerelease': None, 'build': None})
2121

2222
* Into a tuple with :meth:`~semver.version.Version.to_tuple`::

‎docs/usage/create-a-version.rst

Copy file name to clipboardExpand all lines: docs/usage/create-a-version.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Depending on your use case, the following methods are available:
8989

9090
To access individual parts, you can use the function :func:`semver.parse`::
9191

92-
>>> semver.parse("3.4.5-pre.2+build.4")
92+
>>> semver.parse("3.4.5-pre.2+build.4") #doctest: +SKIP
9393
OrderedDict({'major': 3, 'minor': 4, 'patch': 5, 'prerelease': 'pre.2', 'build': 'build.4'})
9494

9595
If you pass an invalid version string you will get a :py:exc:`ValueError`::

‎src/semver/version.py

Copy file name to clipboardExpand all lines: src/semver/version.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def to_dict(self) -> VersionDict:
227227
:return: an OrderedDict with the keys in the order ``major``, ``minor``,
228228
``patch``, ``prerelease``, and ``build``.
229229
230-
>>> semver.Version(3, 2, 1).to_dict()
230+
>>> semver.Version(3, 2, 1).to_dict() #doctest: +SKIP
231231
OrderedDict({'major': 3, 'minor': 4, 'patch': 5, 'prerelease': None, \
232232
'build': None})
233233
"""

‎tests/test_semver.py

Copy file name to clipboardExpand all lines: tests/test_semver.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def test_should_versioninfo_to_dict(version):
2828
resultdict = version.to_dict()
2929
assert isinstance(resultdict, dict), "Got type from to_dict"
3030
assert list(resultdict.keys()) == ["major", "minor", "patch", "prerelease", "build"]
31+
assert tuple(resultdict.values()) == tuple(version)
3132

3233

3334
def test_should_versioninfo_to_tuple(version):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.