From 58390838e712b15bed067bbc83b89b3fb4575dd9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sat, 16 Sep 2023 11:59:01 -0400 Subject: [PATCH] Add docstring to test_version Signed-off-by: Jean-Christophe Morin --- src/rez/cli/selftest.py | 3 +++ src/rez/tests/test_version.py | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/rez/cli/selftest.py b/src/rez/cli/selftest.py index ef9e8a5de7..a4b6fcf522 100644 --- a/src/rez/cli/selftest.py +++ b/src/rez/cli/selftest.py @@ -59,6 +59,9 @@ def __call__(self, parser, namespace, values, option_string=None): # create argparse entry for each module's unit test for name, module in sorted(tests): + if not module.__doc__: + raise RuntimeError("Module {0!r} doesn't have a docstring. Please add one.".format(module.__file__)) + parser.add_argument( "--%s" % name, action=AddTestModuleAction, nargs=0, dest="module_tests", default=[], diff --git a/src/rez/tests/test_version.py b/src/rez/tests/test_version.py index e5d68c1999..0b49c774ef 100644 --- a/src/rez/tests/test_version.py +++ b/src/rez/tests/test_version.py @@ -1,16 +1,18 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project +""" +unit tests for 'rez.version' module +""" +import random +import textwrap +import unittest from rez.version import Version, AlphanumericVersionToken, \ VersionRange, reverse_sort_key from rez.version._version import _ReversedComparable from rez.version import Requirement, RequirementList from rez.version import VersionError -import random -import textwrap -import unittest - def _print(txt=''):