diff options
author | Benjamin Berg <bberg@redhat.com> | 2018-11-13 02:32:28 +0100 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2018-11-13 02:32:28 +0100 |
commit | 1ab42b4ec5e9c731391637f1ced3db2ba3c70f92 (patch) | |
tree | 6116e8f72cc671c8d702e2a501318daeca8bf680 /tests | |
parent | f649308f1f3d275055f6281deeb7333a7729262b (diff) | |
download | gnome-control-center-1ab42b4ec5e9c731391637f1ced3db2ba3c70f92.tar.gz |
tests: Ensure generated function have a __qualname__ attribute
This is solely used for filtering by unittest, however, if it is
missing, then unittest will fail. So generate a reasonable name (which
is unfortunately not identical to the real name of the attribute).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/shared/gtest.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/shared/gtest.py b/tests/shared/gtest.py index 259da775e..a29eee553 100644 --- a/tests/shared/gtest.py +++ b/tests/shared/gtest.py @@ -34,6 +34,10 @@ class _GTestSingleProp(object): bound_method = self.__func.__get__(obj, cls) partial_method = functools.partial(bound_method, self.test) partial_method.__doc__ = bound_method.__doc__ + # Set a qualified name using the qualified name of the class and + # function. Note that this is different from the generated attribute + # name as it is missing the test_%03d_ prefix. + partial_method.__qualname__ = '%s.%s' % (cls.__qualname__, self.test) return partial_method |