aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtGui/qcolor_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/QtGui/qcolor_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/QtGui/qcolor_test.py')
-rw-r--r--sources/pyside6/tests/QtGui/qcolor_test.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/sources/pyside6/tests/QtGui/qcolor_test.py b/sources/pyside6/tests/QtGui/qcolor_test.py
index 6eaaa94a9..85ba2de2d 100644
--- a/sources/pyside6/tests/QtGui/qcolor_test.py
+++ b/sources/pyside6/tests/QtGui/qcolor_test.py
@@ -50,21 +50,21 @@ class QColorGetTest(unittest.TestCase):
self.assertEqual(self.color.getRgb(), (20, 40, 60, 80))
def testGetHslF(self):
- hls = colorsys.rgb_to_hls(20.0/255, 40.0/255, 60.0/255)
+ hls = colorsys.rgb_to_hls(20.0 / 255, 40.0 / 255, 60.0 / 255)
hsla = hls[0], hls[2], hls[1], self.color.alphaF()
- for x, y in zip(self.color.getHslF(), hsla): # Due to rounding problems
- self.assertTrue(x - y < 1/100000.0)
+ for x, y in zip(self.color.getHslF(), hsla): # Due to rounding problems
+ self.assertTrue(x - y < 1 / 100000.0)
def testGetHsv(self):
- hsv = colorsys.rgb_to_hsv(20.0/255, 40.0/255, 60.0/255)
- hsva = int(hsv[0]*360.0), int(hsv[1]*255), int(hsv[2]*256), self.color.alpha()
+ hsv = colorsys.rgb_to_hsv(20.0 / 255, 40.0 / 255, 60.0 / 255)
+ hsva = int(hsv[0] * 360.0), int(hsv[1] * 255), int(hsv[2] * 256), self.color.alpha()
self.assertEqual(self.color.getHsv(), hsva)
- def testGetCmyk(self): # not supported by colorsys
+ def testGetCmyk(self): # not supported by colorsys
self.assertEqual(self.color.getCmyk(), (170, 85, 0, 195, 80))
- def testGetCmykF(self): # not supported by colorsys
- for x, y in zip(self.color.getCmykF(), (170/255.0, 85/255.0, 0, 195/255.0, 80/255.0)):
+ def testGetCmykF(self): # not supported by colorsys
+ for x, y in zip(self.color.getCmykF(), (170 / 255.0, 85 / 255.0, 0, 195 / 255.0, 80 / 255.0)):
self.assertTrue(x - y < 1/10000.0)
@@ -76,7 +76,7 @@ class QColorQRgbConstructor(unittest.TestCase):
def testBasic(self):
'''QColor(QRgb)'''
color = QColor(255, 0, 0)
- #QRgb format #AARRGGBB
+ # QRgb format #AARRGGBB
rgb = 0x00FF0000
self.assertEqual(QColor(rgb), color)
@@ -126,5 +126,6 @@ class QColorRepr(unittest.TestCase):
c2 = eval(c.__str__())
self.assertEqual(c, c2)
+
if __name__ == '__main__':
unittest.main()