Check for QtValueErrors in interpolate_color tests.
This commit is contained in:
parent
ca74fa28ac
commit
20e8c464e6
@ -32,6 +32,7 @@ from PyQt5.QtGui import QColor
|
|||||||
|
|
||||||
import qutebrowser.utils.misc as utils
|
import qutebrowser.utils.misc as utils
|
||||||
from qutebrowser.test.helpers import environ_set_temp, fake_keyevent
|
from qutebrowser.test.helpers import environ_set_temp, fake_keyevent
|
||||||
|
from qutebrowser.utils.qt import QtValueError
|
||||||
|
|
||||||
|
|
||||||
class Color(QColor):
|
class Color(QColor):
|
||||||
@ -356,12 +357,12 @@ class InterpolateColorTests(unittest.TestCase):
|
|||||||
|
|
||||||
def test_invalid_start(self):
|
def test_invalid_start(self):
|
||||||
"""Test an invalid start color."""
|
"""Test an invalid start color."""
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(QtValueError):
|
||||||
utils.interpolate_color(Color(), self.white, 0)
|
utils.interpolate_color(Color(), self.white, 0)
|
||||||
|
|
||||||
def test_invalid_end(self):
|
def test_invalid_end(self):
|
||||||
"""Test an invalid end color."""
|
"""Test an invalid end color."""
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(QtValueError):
|
||||||
utils.interpolate_color(self.white, Color(), 0)
|
utils.interpolate_color(self.white, Color(), 0)
|
||||||
|
|
||||||
def test_invalid_percentage(self):
|
def test_invalid_percentage(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user