Skip to content

Commit

Permalink
Rename tests to match pytest conventions and restore coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Oct 12, 2023
1 parent 5f3f91a commit c6019b9
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cssutils/tests/test_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def read(self, size=-1):
return s


class CodecTestCase:
class TestCodec:
def test_detectencoding_str(self):
"codec.detectencoding_str()"
assert codec.detectencoding_str(b'') == (None, False)
Expand Down
2 changes: 1 addition & 1 deletion cssutils/tests/test_cssstylerule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Testcases for cssutils.css.CSSStyleRuleTestCase"""
"""Test cases for cssutils.css.CSSStyleRule"""

import xml.dom
from . import test_cssrule
Expand Down
2 changes: 1 addition & 1 deletion cssutils/tests/test_cssutilsimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import cssutils


class CSSutilsImportTestCase:
class TestCSSutilsImport:
def test_import_all(self):
"from cssutils import *"
namespace = {}
Expand Down
2 changes: 1 addition & 1 deletion cssutils/tests/test_domimplementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import cssutils


class DOMImplementationTestCase:
class TestDOMImplementation:
def setup(self):
self.domimpl = cssutils.DOMImplementationCSS()

Expand Down
2 changes: 1 addition & 1 deletion cssutils/tests/test_scripts_csscombine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cssutils


class CSSCombine:
class TestCSSCombine:
C = '@namespace s2"uri";s2|sheet-1{top:1px}s2|sheet-2{top:2px}proxy{top:3px}'

def test_combine(self):
Expand Down
6 changes: 3 additions & 3 deletions cssutils/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pytest


class ListSeqTestCase:
class TestListSeq:
def test_all(self):
"util.ListSeq"
ls = ListSeq()
Expand Down Expand Up @@ -44,7 +44,7 @@ def test_all(self):
assert 2 == x


class BaseTestCase:
class TestBase:
def test_normalize(self):
"Base._normalize()"
b = Base()
Expand Down Expand Up @@ -144,7 +144,7 @@ def maketokens(valuelist):
assert exp == res


class _readUrl_TestCase:
class Test_readUrl:
"""needs mock"""

def test_readUrl(self):
Expand Down
18 changes: 10 additions & 8 deletions cssutils/tests/test_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import types
import pytest

from . import basetest

class PropertyValueTestCase:

class TestPropertyValue(basetest.BaseTestCase):
def setup(self):
self.r = cssutils.css.PropertyValue()

Expand Down Expand Up @@ -373,7 +375,7 @@ def test_reprANDstr(self):
assert cssText == s2.cssText


class ValueTestCase:
class TestValue:
def test_init(self):
"Value.__init__()"
v = cssutils.css.Value()
Expand Down Expand Up @@ -414,7 +416,7 @@ def test_cssText(self):
assert n == v.value


class ColorValueTestCase:
class TestColorValue(basetest.BaseTestCase):
def test_init(self):
"ColorValue.__init__()"
v = cssutils.css.ColorValue()
Expand Down Expand Up @@ -518,7 +520,7 @@ def test_rgb(self):
assert c.alpha == rgba[3]


class URIValueTestCase:
class TestURIValue(basetest.BaseTestCase):
def test_init(self):
"URIValue.__init__()"
v = cssutils.css.URIValue()
Expand Down Expand Up @@ -588,7 +590,7 @@ def test_cssText(self):
self.do_raise_r(tests)


class DimensionValueTestCase:
class TestDimensionValue:
def test_init(self):
"DimensionValue.__init__()"
v = cssutils.css.DimensionValue()
Expand Down Expand Up @@ -645,7 +647,7 @@ def test_cssText(self):
assert d == v.dimension


class CSSFunctionTestCase:
class TestCSSFunction:
def test_init(self):
"CSSFunction.__init__()"
v = cssutils.css.CSSFunction()
Expand Down Expand Up @@ -673,7 +675,7 @@ def test_cssText(self):
assert value == v.value


class CSSVariableTestCase:
class TestCSSVariable:
def test_init(self):
"CSSVariable.__init__()"
v = cssutils.css.CSSVariable()
Expand Down Expand Up @@ -773,7 +775,7 @@ def test_cssValueType(self):


@pytest.mark.xfail(reason="not implemented")
class CSSPrimitiveValueTestCase:
class TestCSSPrimitiveValue:
def test_init(self):
"CSSPrimitiveValue.__init__()"
v = cssutils.css.CSSPrimitiveValue('1')
Expand Down
2 changes: 1 addition & 1 deletion cssutils/tests/test_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import cssutils


class XTestCase:
class TestX:
@pytest.mark.xfail(reason="not implemented")
def test_priority(self):
"Property.priority"
Expand Down

0 comments on commit c6019b9

Please sign in to comment.