tox/pytest: Activate doctest-module

Related to D3899#96289
This commit is contained in:
Antoine R. Dumont (@ardumont) 2020-09-10 11:43:25 +02:00
parent 31efda62e7
commit d1ce9b0912
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8
3 changed files with 6 additions and 7 deletions

View file

@ -288,13 +288,11 @@ def get_version(uri: str) -> str:
Version detected
Example:
For uri = https://ftp.gnu.org/gnu/8sync/8sync-0.2.0.tar.gz
>>> uri = 'https://ftp.gnu.org/gnu/8sync/8sync-0.2.0.tar.gz'
>>> get_version(uri)
'0.2.0'
For uri = 8sync-0.3.0.tar.gz
>>> uri = '8sync-0.3.0.tar.gz'
>>> get_version(uri)
'0.3.0'

View file

@ -9,13 +9,13 @@ def split_range(total_pages: int, nb_pages: int) -> Iterator[Tuple[int, int]]:
"""Split `total_pages` into mostly `nb_pages` ranges. In some cases, the last range can
have one more element.
>>> split_range(19, 10)
>>> list(split_range(19, 10))
[(0, 9), (10, 19)]
>>> split_range(20, 3)
>>> list(split_range(20, 3))
[(0, 2), (3, 5), (6, 8), (9, 11), (12, 14), (15, 17), (18, 20)]
>>> split_range(21, 3)
>>> list(split_range(21, 3))
[(0, 2), (3, 5), (6, 8), (9, 11), (12, 14), (15, 17), (18, 21)]
"""