Skip to content

Commit

Permalink
👹 Feed the hobgoblins (delint).
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 19, 2024
1 parent 605c022 commit 8765fdf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion cssutils/css/value.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ class ColorValue(Value):

from .colors import COLORS

type = Value.COLOR_VALUE
# hexcolor, FUNCTION?
_colorType = None
_red = 0
Expand Down
6 changes: 2 additions & 4 deletions cssutils/tests/test_cssstyledeclaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ def test__iter__item(self):
border: 0;
'''
# __iter__
ps = []
for p in s:
ps.append((p.literalname, p.value, p.priority))
ps = [(p.literalname, p.value, p.priority) for p in s]
assert len(ps) == 3
assert ps[0] == (r'co\lor', 'green', '')
assert ps[1] == (r'left', '1px', 'important')
Expand Down Expand Up @@ -184,7 +182,7 @@ def test_children(self):

def t(s):
for i, x in enumerate(s.children()):
assert types[i] == type(x)
assert isinstance(x, types[i])
assert x.parent == s

t(cssutils.parseStyle(style))
Expand Down
4 changes: 2 additions & 2 deletions cssutils/tests/test_cssvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def test_cssValueType(self):
assert value == v.cssText
assert name == v.cssValueTypeString
assert getattr(v, name) == v.cssValueType
assert cls == type(v)
assert isinstance(v, cls)

def test_readonly(self):
"(CSSValue._readonly)"
Expand Down Expand Up @@ -636,7 +636,7 @@ def test_setFloat(self):
initialType, initialValue = test
pv = cssutils.css.CSSPrimitiveValue(initialValue)
for setType, setValue, exp, cssText in tests[test]:
if type(exp) == type or type(exp) == type: # 2.4 compatibility
if isinstance(exp, type):
if cssText:
with pytest.raises(exp, match=cssText):
pv.setFloatValue(setType, setValue)
Expand Down
4 changes: 1 addition & 3 deletions cssutils/tests/test_cssvariablesdeclaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ def test_items(self):
assert 0 == v.length

v.cssText = 'x:0; y:1'
keys = []
# unsorted!
for i in range(0, v.length):
keys.append(v.item(i))
keys = [v.item(i) for i in range(0, v.length)]
assert sorted(keys) == ['x', 'y']

def test_keys(self):
Expand Down
2 changes: 1 addition & 1 deletion cssutils/tests/test_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ def test_cssValueType(self):
assert value == v.cssText
assert name == v.cssValueTypeString
assert getattr(v, name) == v.cssValueType
assert cls == type(v)
assert isinstance(v, cls)


@pytest.mark.xfail(reason="not implemented")
Expand Down

0 comments on commit 8765fdf

Please sign in to comment.