aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/pysidetest/property_python_test.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-29 11:18:49 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-04-29 15:56:58 +0200
commit6d2af409eedee377b3c2ba0cd8156b9409fabd9d (patch)
tree660f8fd87f77c1030cf97cc65345b9a941a321e4 /sources/pyside6/tests/pysidetest/property_python_test.py
parent88fff87519e741a3a999b8c1545834d116859faa (diff)
Tests: Fix some space-related flake8 warnings
Change-Id: I9b0ad08839bf1246620c557ec304dfa90882907b Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/tests/pysidetest/property_python_test.py')
-rw-r--r--sources/pyside6/tests/pysidetest/property_python_test.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/sources/pyside6/tests/pysidetest/property_python_test.py b/sources/pyside6/tests/pysidetest/property_python_test.py
index 6e19e92a0..baf4cdb01 100644
--- a/sources/pyside6/tests/pysidetest/property_python_test.py
+++ b/sources/pyside6/tests/pysidetest/property_python_test.py
@@ -49,7 +49,6 @@ from init_paths import init_test_paths
init_test_paths(False)
from PySide6.QtCore import Property, QObject
-#from PyQt5.QtCore import pyqtProperty as Property, QObject
# This are the original imports.
import sys
@@ -61,18 +60,23 @@ try:
except ImportError:
pass
+
class PropertyBase(Exception):
pass
+
class PropertyGet(PropertyBase):
pass
+
class PropertySet(PropertyBase):
pass
+
class PropertyDel(PropertyBase):
pass
+
class BaseClass(QObject):
def __init__(self):
super().__init__()
@@ -92,6 +96,7 @@ class BaseClass(QObject):
def spam(self):
del self._spam
+
class SubClass(BaseClass):
@BaseClass.spam.getter
@@ -107,24 +112,29 @@ class SubClass(BaseClass):
def spam(self):
raise PropertyDel(self._spam)
+
class PropertyDocBase(object):
_spam = 1
+
def _get_spam(self):
return self._spam
spam = Property(object, _get_spam, doc="spam spam spam")
+
class PropertyDocSub(PropertyDocBase):
@PropertyDocBase.spam.getter
def spam(self):
"""The decorator does not use this doc string"""
return self._spam
+
class PropertySubNewGetter(BaseClass):
@BaseClass.spam.getter
def spam(self):
"""new docstring"""
return 5
+
class PropertyNewGetter(QObject):
def __init__(self):
super().__init__()
@@ -133,11 +143,13 @@ class PropertyNewGetter(QObject):
def spam(self):
"""original docstring"""
return 1
+
@spam.getter
def spam(self):
"""new docstring"""
return 8
+
class PropertyTests(unittest.TestCase):
def test_property_decorator_baseclass(self):
# see #1620