python-cssutils fails to build with pytest 8. =================================== FAILURES =================================== _________________________ TestCSSCharsetRule.test_init _________________________ self = <cssutils.tests.test_csscharsetrule.TestCSSCharsetRule object at 0x7f35b98b6a50> def test_init(self): "CSSCharsetRule.__init__()" > super().test_init() cssutils/tests/test_csscharsetrule.py:18: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csscharsetrule.TestCSSCharsetRule object at 0x7f35b98b6a50> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSCharsetRule' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError ________________ TestCSSCharsetRule.test_InvalidModificationErr ________________ self = <cssutils.tests.test_csscharsetrule.TestCSSCharsetRule object at 0x7f35b98b67b0> def test_InvalidModificationErr(self): "CSSCharsetRule InvalidModificationErr" > self._test_InvalidModificationErr('@charset') cssutils/tests/test_csscharsetrule.py:27: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csscharsetrule.TestCSSCharsetRule object at 0x7f35b98b67b0> startwithspace = '@charset' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSCharsetRule' object has no attribute 'r' cssutils/tests/test_cssrule.py:244: AttributeError _______________________ TestCSSCharsetRule.test_encoding _______________________ self = <cssutils.tests.test_csscharsetrule.TestCSSCharsetRule object at 0x7f35b9796990> def test_encoding(self): "CSSCharsetRule.encoding" for enc in ('UTF-8', 'utf-8', 'iso-8859-1', 'ascii'): > self.r.encoding = enc E AttributeError: 'TestCSSCharsetRule' object has no attribute 'r' cssutils/tests/test_csscharsetrule.py:51: AttributeError _______________________ TestCSSCharsetRule.test_cssText ________________________ self = <cssutils.tests.test_csscharsetrule.TestCSSCharsetRule object at 0x7f35b97eef60> def test_cssText(self): """CSSCharsetRule.cssText setting cssText is ok to use @CHARSET or other but a file using parse MUST use ``@charset "ENCODING";`` """ tests = { '@charset "utf-8";': None, "@charset 'utf-8';": '@charset "utf-8";', } > self.do_equal_r(tests) cssutils/tests/test_csscharsetrule.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csscharsetrule.TestCSSCharsetRule object at 0x7f35b97eef60> tests = {'@charset "utf-8";': None, "@charset 'utf-8';": '@charset "utf-8";'} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSCharsetRule' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError _________________________ TestCSSCharsetRule.test_repr _________________________ self = <cssutils.tests.test_csscharsetrule.TestCSSCharsetRule object at 0x7f35b97edfa0> def test_repr(self): "CSSCharsetRule.__repr__()" > self.r.encoding = 'utf-8' E AttributeError: 'TestCSSCharsetRule' object has no attribute 'r' cssutils/tests/test_csscharsetrule.py:99: AttributeError ___________________________ TestCSSComment.test_init ___________________________ self = <cssutils.tests.test_csscomment.TestCSSComment object at 0x7f35b97eeae0> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSComment' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError _________________________ TestCSSComment.test_csstext __________________________ self = <cssutils.tests.test_csscomment.TestCSSComment object at 0x7f35b97ee2d0> def test_csstext(self): "CSSComment.cssText" tests = { '/*öäü߀ÖÄÜ*/': '/*\xf6\xe4\xfc\xdf\u20ac\xd6\xc4\xdc*/', '/*x*/': None, '/* x */': None, '/*\t12\n*/': None, '/* /* */': None, '/* \\*/': None, '/*"*/': None, '''/*" */''': None, '/** / ** //*/': None, } > self.do_equal_r(tests) # set cssText cssutils/tests/test_csscomment.py:29: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csscomment.TestCSSComment object at 0x7f35b97ee2d0> tests = {'/*\t12\n*/': None, '/* /* */': None, '/* \\*/': None, '/* x */': None, ...} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSComment' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError __________________ TestCSSComment.test_InvalidModificationErr __________________ self = <cssutils.tests.test_csscomment.TestCSSComment object at 0x7f35b97ee900> def test_InvalidModificationErr(self): "CSSComment.cssText InvalidModificationErr" > self._test_InvalidModificationErr('/* comment */') cssutils/tests/test_csscomment.py:53: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csscomment.TestCSSComment object at 0x7f35b97ee900> startwithspace = '/* comment */' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSComment' object has no attribute 'r' cssutils/tests/test_cssrule.py:244: AttributeError ________________________ TestCSSFontFaceRule.test_init _________________________ self = <cssutils.tests.test_cssfontfacerule.TestCSSFontFaceRule object at 0x7f35b97e7e90> def test_init(self): "CSSFontFaceRule.__init__()" > super().test_init() cssutils/tests/test_cssfontfacerule.py:20: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssfontfacerule.TestCSSFontFaceRule object at 0x7f35b97e7e90> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSFontFaceRule' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError _______________________ TestCSSFontFaceRule.test_cssText _______________________ self = <cssutils.tests.test_cssfontfacerule.TestCSSFontFaceRule object at 0x7f35b97e7620> def test_cssText(self): "CSSFontFaceRule.cssText" tests = { '''@font-face { font-family: x; src: url(../fonts/LateefRegAAT.ttf) format("truetype-aat"), url(../fonts/LateefRegOT.ttf) format("opentype"); font-style: italic; font-weight: 500; font-stretch: condensed; unicode-range: u+1-ff, u+111 }''': None, '@font-face{font-family: x;}': '@font-face {\n font-family: x\n }', '@font-face { font-family: x; }': '@font-face {\n font-family: x\n }', '@f\\ont\\-face{font-family : x;}': '@font-face {\n font-family: x\n }', # comments '@font-face/*1*//*2*/{font-family: x;}': '@font-face /*1*/ /*2*/ {\n font-family: x\n }', # WS '@font-face\n\t\f {\n\t\f font-family:x;\n\t\f }': '@font-face {\n font-family: x\n }', } > self.do_equal_r(tests) cssutils/tests/test_cssfontfacerule.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssfontfacerule.TestCSSFontFaceRule object at 0x7f35b97e7620> tests = {'@f\\ont\\-face{font-family : x;}': '@font-face {\n font-family: x\n }', '@font-face\n\t\x0c {\n\t\x0c font-fam...yle: italic;\n font-weight: 500;\n font-stretch: condensed;\n unicode-range: u+1-ff, u+111\n }': None, ...} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSFontFaceRule' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError _______________ TestCSSFontFaceRule.test_InvalidModificationErr ________________ self = <cssutils.tests.test_cssfontfacerule.TestCSSFontFaceRule object at 0x7f35b97e9c40> def test_InvalidModificationErr(self): "CSSFontFaceRule.cssText InvalidModificationErr" > self._test_InvalidModificationErr('@font-face') cssutils/tests/test_cssfontfacerule.py:205: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssfontfacerule.TestCSSFontFaceRule object at 0x7f35b97e9c40> startwithspace = '@font-face' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSFontFaceRule' object has no attribute 'r' cssutils/tests/test_cssrule.py:244: AttributeError _________________________ TestCSSImportRule.test_init __________________________ self = <cssutils.tests.test_cssimportrule.TestCSSImportRule object at 0x7f35b96d5a90> def test_init(self): "CSSImportRule.__init__()" > super().test_init() cssutils/tests/test_cssimportrule.py:21: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssimportrule.TestCSSImportRule object at 0x7f35b96d5a90> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSImportRule' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError ________________________ TestCSSImportRule.test_cssText ________________________ self = <cssutils.tests.test_cssimportrule.TestCSSImportRule object at 0x7f35b96d5cd0> def test_cssText(self): "CSSImportRule.cssText" tests = { # href string '''@import "str";''': None, '''@import"str";''': '''@import "str";''', '''@\\import "str";''': '''@import "str";''', '''@IMPORT "str";''': '''@import "str";''', '''@import 'str';''': '''@import "str";''', '''@import 'str' ;''': '''@import "str";''', '''@import "str";''': None, '''@import "str" ;''': '''@import "str";''', r'''@import "\"" ;''': r'''@import "\"";''', '''@import '\\'';''': r'''@import "'";''', '''@import '"';''': r'''@import "\"";''', # href url '''@import url(x.css);''': None, # nospace '''@import url(")");''': '''@import url(")");''', '''@import url("\\"");''': '''@import url("\\"");''', '''@import url('\\'');''': '''@import url("'");''', # href + media # all is removed '''@import "str" all;''': '''@import "str";''', '''@import "str" tv, print;''': None, '''@import"str"tv,print;''': '''@import "str" tv, print;''', '''@import "str" tv, print, all;''': '''@import "str";''', '''@import "str" handheld, all;''': '''@import "str";''', '''@import "str" all, handheld;''': '''@import "str";''', '''@import "str" not tv;''': None, '''@import "str" only tv;''': None, '''@import "str" only tv and (color: 2);''': None, # href + name '''@import "str" "name";''': None, '''@import "str" 'name';''': '''@import "str" "name";''', '''@import url(x) "name";''': None, '''@import "str" "\\"";''': None, '''@import "str" '\\'';''': '''@import "str" "'";''', # href + media + name '''@import"str"tv"name";''': '''@import "str" tv "name";''', '''@import\t\r\f\n"str"\t\t\r\f\ntv\t\t\r\f\n"name"\t;''': '''@import "str" tv "name";''', # comments '''@import /*1*/ "str" /*2*/;''': None, '@import/*1*//*2*/"str"/*3*//*4*/all/*5*//*6*/"name"/*7*//*8*/ ;': '@import /*1*/ /*2*/ "str" /*3*/ /*4*/ all /*5*/ /*6*/ "name" /*7*/ /*8*/;', '@import/*1*//*2*/url(u)/*3*//*4*/all/*5*//*6*/"name"/*7*//*8*/ ;': '@import /*1*/ /*2*/ url(u) /*3*/ /*4*/ all /*5*/ /*6*/ "name" /*7*/ /*8*/;', '@import/*1*//*2*/url("u")/*3*//*4*/all/*5*//*6*/"name"/*7*//*8*/ ;': '@import /*1*/ /*2*/ url(u) /*3*/ /*4*/ all /*5*/ /*6*/ "name" /*7*/ /*8*/;', # WS '@import\n\t\f "str"\n\t\f tv\n\t\f "name"\n\t\f ;': '@import "str" tv "name";', '@import\n\t\f url(\n\t\f u\n\t\f )\n\t\f tv\n\t\f "name"\n\t\f ;': '@import url(u) tv "name";', '@import\n\t\f url("u")\n\t\f tv\n\t\f "name"\n\t\f ;': '@import url(u) tv "name";', '@import\n\t\f url(\n\t\f "u"\n\t\f )\n\t\f tv\n\t\f "name"\n\t\f ;': '@import url(u) tv "name";', } > self.do_equal_r(tests) # set cssText cssutils/tests/test_cssimportrule.py:135: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssimportrule.TestCSSImportRule object at 0x7f35b96d5cd0> tests = {'@IMPORT "str";': '@import "str";', '@\\import "str";': '@import "str";', '@import\t\r\x0c\n"str"\t\t\r\x0c\ntv\t\t\r...import "str" tv "name";', '@import\n\t\x0c "str"\n\t\x0c tv\n\t\x0c "name"\n\t\x0c ;': '@import "str" tv "name";', ...} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSImportRule' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError _________________________ TestCSSImportRule.test_href __________________________ self = <cssutils.tests.test_cssimportrule.TestCSSImportRule object at 0x7f35b96d5b20> def test_href(self): "CSSImportRule.href" # set > self.r.href = 'x' E AttributeError: 'TestCSSImportRule' object has no attribute 'r' cssutils/tests/test_cssimportrule.py:178: AttributeError _________________________ TestCSSImportRule.test_media _________________________ self = <cssutils.tests.test_cssimportrule.TestCSSImportRule object at 0x7f35b96d4920> def test_media(self): "CSSImportRule.media" > self.r.href = 'x' # @import url(x) E AttributeError: 'TestCSSImportRule' object has no attribute 'r' cssutils/tests/test_cssimportrule.py:250: AttributeError ________________ TestCSSImportRule.test_InvalidModificationErr _________________ self = <cssutils.tests.test_cssimportrule.TestCSSImportRule object at 0x7f35b96d4a40> def test_InvalidModificationErr(self): "CSSImportRule.cssText InvalidModificationErr" > self._test_InvalidModificationErr('@import') cssutils/tests/test_cssimportrule.py:414: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssimportrule.TestCSSImportRule object at 0x7f35b96d4a40> startwithspace = '@import' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSImportRule' object has no attribute 'r' cssutils/tests/test_cssrule.py:244: AttributeError __________________________ TestCSSMediaRule.test_init __________________________ self = <cssutils.tests.test_cssmediarule.TestCSSMediaRule object at 0x7f35b971b9e0> def test_init(self): "CSSMediaRule.__init__()" > super().test_init() cssutils/tests/test_cssmediarule.py:23: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssmediarule.TestCSSMediaRule object at 0x7f35b971b9e0> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSMediaRule' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError ________________________ TestCSSMediaRule.test_cssText _________________________ self = <cssutils.tests.test_cssmediarule.TestCSSMediaRule object at 0x7f35b9718bc0> def test_cssText(self): "CSSMediaRule.cssText" style = '''{ a { color: red } }''' mls = { ' (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) ': None, ' tv ': None, ' only tv ': None, ' not tv ': None, ' only tv and (color) ': None, ' only tv and(color)': ' only tv and (color) ', ' only tv and (color: red) ': None, ' only tv and (color: red) and (width: 100px) ': None, ' only tv and (color: red) and (width: 100px), tv ': None, ' only tv and (color: red) and (width: 100px), tv and (width: 20px) ': None, ' only tv and(color :red)and( width :100px ) ,tv and(width: 20px) ': ' only tv and (color: red) and (width: 100px), tv and (width: 20px) ', ' (color: red) and (width: 100px), (width: 20px) ': None, ' /*1*/ only /*2*/ tv /*3*/ and /*4*/ (/*5*/ width) /*5*/ /*6*/, (color) and (height) ': None, '(color)and(width),(height)': ' (color) and (width), (height) ', } tests = {} for b, a in list(mls.items()): if a is None: a = b tests['@media{}{}'.format(b, style)] = '@media{}{}'.format(a, style) self.do_equal_p(tests) > self.do_equal_r(tests) cssutils/tests/test_cssmediarule.py:144: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssmediarule.TestCSSMediaRule object at 0x7f35b9718bc0> tests = {'@media (color: red) and (width: 100px), (width: 20px) {\n a {\n color: red\n }\n }': '@media (co...n a {\n color: red\n }\n }': '@media not tv {\n a {\n color: red\n }\n }', ...} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSMediaRule' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError _________________________ TestCSSMediaRule.test_media __________________________ self = <cssutils.tests.test_cssmediarule.TestCSSMediaRule object at 0x7f35b9719d90> def test_media(self): "CSSMediaRule.media" # see CSSImportRule.media # setting not allowed with pytest.raises(AttributeError): self.r.__setattr__('media', None) with pytest.raises(AttributeError): self.r.__setattr__('media', 0) # set mediaText instead > self.r.media.mediaText = 'print' E AttributeError: 'TestCSSMediaRule' object has no attribute 'r' cssutils/tests/test_cssmediarule.py:261: AttributeError _________________ TestCSSMediaRule.test_InvalidModificationErr _________________ self = <cssutils.tests.test_cssmediarule.TestCSSMediaRule object at 0x7f35b9719190> def test_InvalidModificationErr(self): "CSSMediaRule.cssText InvalidModificationErr" > self._test_InvalidModificationErr('@media') cssutils/tests/test_cssmediarule.py:423: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssmediarule.TestCSSMediaRule object at 0x7f35b9719190> startwithspace = '@media' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSMediaRule' object has no attribute 'r' cssutils/tests/test_cssrule.py:244: AttributeError ________________________ TestCSSNamespaceRule.test_init ________________________ self = <cssutils.tests.test_cssnamespacerule.TestCSSNamespaceRule object at 0x7f35b97eb860> def test_init(self): "CSSNamespaceRule.__init__()" tests = [ (None, None), ('', ''), (None, ''), ('', None), ('', 'no-uri'), ] for uri, p in tests: r = cssutils.css.CSSNamespaceRule(namespaceURI=uri, prefix=p) assert r.namespaceURI is None assert '' == r.prefix assert '' == r.cssText assert r.parentStyleSheet is None assert r.parentRule is None r = cssutils.css.CSSNamespaceRule(namespaceURI='example') assert 'example' == r.namespaceURI assert '' == r.prefix assert '@namespace "example";' == r.cssText > self.sheet.add(r) E AttributeError: 'TestCSSNamespaceRule' object has no attribute 'sheet' cssutils/tests/test_cssnamespacerule.py:38: AttributeError _______________ TestCSSNamespaceRule.test_InvalidModificationErr _______________ self = <cssutils.tests.test_cssnamespacerule.TestCSSNamespaceRule object at 0x7f35b97ea780> def test_InvalidModificationErr(self): "CSSNamespaceRule.cssText InvalidModificationErr" > self._test_InvalidModificationErr('@namespace') cssutils/tests/test_cssnamespacerule.py:177: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssnamespacerule.TestCSSNamespaceRule object at 0x7f35b97ea780> startwithspace = '@namespace' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSNamespaceRule' object has no attribute 'r' cssutils/tests/test_cssrule.py:244: AttributeError _____________________ TestCSSNamespaceRule.test_incomplete _____________________ self = <cssutils.tests.test_cssnamespacerule.TestCSSNamespaceRule object at 0x7f35b97eaea0> def test_incomplete(self): "CSSNamespaceRule (incomplete)" tests = { '@namespace "uri': '@namespace "uri";', "@namespace url(x": '@namespace "x";', "@namespace url('x": '@namespace "x";', '@namespace url("x;': '@namespace "x;";', '@namespace url( "x;': '@namespace "x;";', '@namespace url("x ': '@namespace "x ";', '@namespace url(x ': '@namespace "x";', } self.do_equal_p(tests) # parse tests = { '@namespace "uri': xml.dom.SyntaxErr, "@namespace url(x": xml.dom.SyntaxErr, "@namespace url('x": xml.dom.SyntaxErr, '@namespace url("x;': xml.dom.SyntaxErr, '@namespace url( "x;': xml.dom.SyntaxErr, '@namespace url("x ': xml.dom.SyntaxErr, '@namespace url(x ': xml.dom.SyntaxErr, } > self.do_raise_r(tests) # set cssText cssutils/tests/test_cssnamespacerule.py:200: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssnamespacerule.TestCSSNamespaceRule object at 0x7f35b97eaea0> tests = {'@namespace "uri': <class 'xml.dom.SyntaxErr'>, '@namespace url( "x;': <class 'xml.dom.SyntaxErr'>, '@namespace url("x ': <class 'xml.dom.SyntaxErr'>, '@namespace url("x;': <class 'xml.dom.SyntaxErr'>, ...} att = '_setCssText' def do_raise_r(self, tests, att='_setCssText'): # set self.r and expect raise for test, expected in tests.items(): with pytest.raises(expected): > self.r.__getattribute__(att)(test) E AttributeError: 'TestCSSNamespaceRule' object has no attribute 'r' cssutils/tests/basetest.py:50: AttributeError __________________________ TestCSSPageRule.test_init ___________________________ self = <cssutils.tests.test_csspagerule.TestCSSPageRule object at 0x7f35b971bb90> def test_init(self): "CSSPageRule.__init__()" > super().test_init() cssutils/tests/test_csspagerule.py:22: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csspagerule.TestCSSPageRule object at 0x7f35b971bb90> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSPageRule' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError _________________ TestCSSPageRule.test_InvalidModificationErr __________________ self = <cssutils.tests.test_csspagerule.TestCSSPageRule object at 0x7f35b971bc20> def test_InvalidModificationErr(self): "CSSPageRule.cssText InvalidModificationErr" > self._test_InvalidModificationErr('@page') cssutils/tests/test_csspagerule.py:65: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csspagerule.TestCSSPageRule object at 0x7f35b971bc20> startwithspace = '@page' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSPageRule' object has no attribute 'r' cssutils/tests/test_cssrule.py:244: AttributeError _________________________ TestCSSPageRule.test_cssText _________________________ self = <cssutils.tests.test_csspagerule.TestCSSPageRule object at 0x7f35b971d850> def test_cssText(self): "CSSPageRule.cssText" EXP = '@page %s {\n margin: 0\n }' tests = { '@page {}': '', '@page:left{}': '', '@page :right {}': '', '@page {margin:0;}': '@page {\n margin: 0\n }', '@page name { margin: 0 }': EXP % 'name', '@page name:left { margin: 0 }': EXP % 'name:left', '@page name:right { margin: 0 }': EXP % 'name:right', '@page name:first { margin: 0 }': EXP % 'name:first', '@page :left { margin: 0 }': EXP % ':left', '@page:left { margin: 0 }': EXP % ':left', '@page :right { margin: 0 }': EXP % ':right', '@page :first { margin: 0 }': EXP % ':first', '@page :UNKNOWNIDENT { margin: 0 }': EXP % ':UNKNOWNIDENT', '@PAGE:left{margin:0;}': '@page :left {\n margin: 0\n }', '@\\page:left{margin:0;}': '@page :left {\n margin: 0\n }', # comments '@page/*1*//*2*/:left/*3*//*4*/{margin:0;}': '@page /*1*/ /*2*/ :left /*3*/ /*4*/ {\n margin: 0\n }', # WS '@page:left{margin:0;}': '@page :left {\n margin: 0\n }', '@page\n\r\f\t :left\n\r\f\t {margin:0;}': '@page :left {\n margin: 0\n }', # MarginRule '@page { @top-right { content: "2" } }': '@page {\n @top-right {\n content: "2"\n }\n }', '@page {padding: 1cm; margin: 1cm; @top-left {content: "1"}@top-right {content: "2";left: 1}}': '@page {\n padding: 1cm;\n margin: 1cm;\n @top-left {\n content: "1"\n }\n @top-right {\n content: "2";\n left: 1\n }\n }', '@page {@top-right { content: "1a"; content: "1b"; x: 1 }@top-right { content: "2"; y: 2 }}': '''@page {\n @top-right { content: "1a"; content: "1b"; x: 1; content: "2"; y: 2 }\n }''', } > self.do_equal_r(tests) cssutils/tests/test_csspagerule.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csspagerule.TestCSSPageRule object at 0x7f35b971d850> tests = {'@PAGE:left{margin:0;}': '@page :left {\n margin: 0\n }', '@\\page:left{margin:0;}': '@page :left {\n margin...left {\n margin: 0\n }', '@page :UNKNOWNIDENT { margin: 0 }': '@page :UNKNOWNIDENT {\n margin: 0\n }', ...} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSPageRule' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError ______________________ TestCSSPageRule.test_selectorText _______________________ self = <cssutils.tests.test_csspagerule.TestCSSPageRule object at 0x7f35b971dca0> def test_selectorText(self): "CSSPageRule.selectorText" r = cssutils.css.CSSPageRule() r.selectorText = 'a:left' assert r.selectorText == 'a:left' tests = { '': '', 'name': None, ':right': None, ':first': None, ':UNKNOWNIDENT': None, 'name:left': None, ' :left': ':left', ':left': ':left', '/*1*/:left/*a*/': '/*1*/ :left /*a*/', '/*1*/ :left /*a*/ /*b*/': None, ':left/*a*/': ':left /*a*/', '/*1*/:left': '/*1*/ :left', } > self.do_equal_r(tests, att='selectorText') cssutils/tests/test_csspagerule.py:200: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_csspagerule.TestCSSPageRule object at 0x7f35b971dca0> tests = {'': '', ' :left': ':left', '/*1*/ :left /*a*/ /*b*/': None, '/*1*/:left': '/*1*/ :left', ...} att = 'selectorText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSPageRule' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError ____________________________ TestCSSRule.test_init _____________________________ self = <cssutils.tests.test_cssrule.TestCSSRule object at 0x7f35b971d250> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSRule' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError _____________________ TestCSSStyleDeclaration.test_cssText _____________________ self = <cssutils.tests.test_cssstyledeclaration.TestCSSStyleDeclaration object at 0x7f35b95fc8f0> def test_cssText(self): "CSSStyleDeclaration.cssText" # empty s = cssutils.css.CSSStyleDeclaration() tests = {'': '', ' ': '', ' \t \n ': '', '/*x*/': '/*x*/'} for test, exp in list(tests.items()): s.cssText = 'left: 0;' # dummy to reset s s.cssText = test assert exp == s.cssText # normal s = cssutils.css.CSSStyleDeclaration() tests = { ';': '', 'left: 0': 'left: 0', 'left:0': 'left: 0', ' left : 0 ': 'left: 0', 'left: 0;': 'left: 0', 'left: 0 !important ': 'left: 0 !important', 'left:0!important': 'left: 0 !important', 'left: 0; top: 1': 'left: 0;\ntop: 1', # comments # TODO: spaces? '/*1*//*2*/left/*3*//*4*/:/*5*//*6*/0/*7*//*8*/!/*9*//*a*/important/*b*//*c*/;': '/*1*/\n/*2*/\nleft/*3*//*4*/: /*5*/ /*6*/ 0 /*7*/ /*8*/ !/*9*//*a*/important/*b*//*c*/', '/*1*/left: 0;/*2*/ top: 1/*3*/': '/*1*/\nleft: 0;\n/*2*/\ntop: 1 /*3*/', 'left:0; top:1;': 'left: 0;\ntop: 1', '/*1*/left: 0;/*2*/ top: 1;/*3*/': '/*1*/\nleft: 0;\n/*2*/\ntop: 1;\n/*3*/', # WS 'left:0!important;margin:1px 2px 3px 4px!important;': 'left: 0 !important;\nmargin: 1px 2px 3px 4px !important', '\n\r\f\t left\n\r\f\t :\n\r\f\t 0\n\r\f\t !\n\r\f\t important\n\r\f\t ;\n\r\f\t margin\n\r\f\t :\n\r\f\t 1px\n\r\f\t 2px\n\r\f\t 3px\n\r\f\t 4px;': 'left: 0 !important;\nmargin: 1px 2px 3px 4px', } for test, exp in list(tests.items()): s.cssText = test assert exp == s.cssText # exception tests = { 'color: #xyz': xml.dom.SyntaxErr, 'top': xml.dom.SyntaxErr, 'top:': xml.dom.SyntaxErr, 'top : ': xml.dom.SyntaxErr, 'top:!important': xml.dom.SyntaxErr, 'top:!important;': xml.dom.SyntaxErr, 'top:;': xml.dom.SyntaxErr, 'top 0': xml.dom.SyntaxErr, 'top 0;': xml.dom.SyntaxErr, ':': xml.dom.SyntaxErr, ':0': xml.dom.SyntaxErr, ':0;': xml.dom.SyntaxErr, ':0!important': xml.dom.SyntaxErr, ':;': xml.dom.SyntaxErr, ': ;': xml.dom.SyntaxErr, ':!important;': xml.dom.SyntaxErr, ': !important;': xml.dom.SyntaxErr, '0': xml.dom.SyntaxErr, '0!important': xml.dom.SyntaxErr, '0!important;': xml.dom.SyntaxErr, '0;': xml.dom.SyntaxErr, '!important': xml.dom.SyntaxErr, '!important;': xml.dom.SyntaxErr, } > self.do_raise_r(tests) cssutils/tests/test_cssstyledeclaration.py:267: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssstyledeclaration.TestCSSStyleDeclaration object at 0x7f35b95fc8f0> tests = {'!important': <class 'xml.dom.SyntaxErr'>, '!important;': <class 'xml.dom.SyntaxErr'>, '0': <class 'xml.dom.SyntaxErr'>, '0!important': <class 'xml.dom.SyntaxErr'>, ...} att = '_setCssText' def do_raise_r(self, tests, att='_setCssText'): # set self.r and expect raise for test, expected in tests.items(): with pytest.raises(expected): > self.r.__getattribute__(att)(test) E AttributeError: 'TestCSSStyleDeclaration' object has no attribute 'r' cssutils/tests/basetest.py:50: AttributeError __________________________ TestCSSStyleRule.test_init __________________________ self = <cssutils.tests.test_cssstylerule.TestCSSStyleRule object at 0x7f35b97ec4a0> def test_init(self): "CSSStyleRule.type and init" > super().test_init() cssutils/tests/test_cssstylerule.py:18: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssstylerule.TestCSSStyleRule object at 0x7f35b97ec4a0> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSStyleRule' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError ________________________ TestCSSStyleRule.test_cssText _________________________ self = <cssutils.tests.test_cssstylerule.TestCSSStyleRule object at 0x7f35b95fcaa0> def test_cssText(self): "CSSStyleRule.cssText" tests = { '* {}': '', 'a {}': '', } self.do_equal_p(tests) # parse # self.do_equal_r(tests) # set cssText # TODO: WHY? cssutils.ser.prefs.keepEmptyRules = True tests = { # u'''a{;display:block;float:left}''': 'a {\n display:block;\n float:left\n }', # issue 28 '''a\n{color: #000}''': 'a {\n color: #000\n }', # issue 4 '''a\n{color: #000000}''': 'a {\n color: #000\n }', # issue 4 '''a\n{color: #abc}''': 'a {\n color: #abc\n }', # issue 4 '''a\n{color: #abcdef}''': 'a {\n color: #abcdef\n }', # issue 4 '''a\n{color: #00a}''': 'a {\n color: #00a\n }', # issue 4 '''a\n{color: #1a1a1a}''': 'a {\n color: #1a1a1a\n }', # issue 4 '''#id\n{ color: red }''': '#id {\n color: red\n }', # issue 3 '''* {}''': None, 'a {}': None, 'b { a: 1; }': 'b {\n a: 1\n }', # mix of comments and properties 'c1 {/*1*/a:1;}': 'c1 {\n /*1*/\n a: 1\n }', 'c2 {a:1;/*2*/}': 'c2 {\n a: 1;\n /*2*/\n }', 'd1 {/*0*/}': 'd1 {\n /*0*/\n }', 'd2 {/*0*//*1*/}': 'd2 {\n /*0*/\n /*1*/\n }', # comments # TODO: spaces? '''a/*1*//*2*/,/*3*//*4*/b/*5*//*6*/{color: #000}''': 'a/*1*//*2*/, /*3*//*4*/b/*5*//*6*/ {\n color: #000\n }', '''a,b{color: #000}''': 'a, b {\n color: #000\n }', # issue 4 '''a\n\r\t\f ,\n\r\t\f b\n\r\t\f {color: #000}''': 'a, b {\n color: #000\n }', # issue 4 } self.do_equal_p(tests) # parse > self.do_equal_r(tests) # set cssText cssutils/tests/test_cssstylerule.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssstylerule.TestCSSStyleRule object at 0x7f35b95fcaa0> tests = {'#id\n{ color: red }': '#id {\n color: red\n }', '* {}': None, 'a\n\r\t\x0c ,\n\r\t\x0c b\n\r\t\x0c {color: #000}': 'a, b {\n color: #000\n }', 'a\n{color: #000000}': 'a {\n color: #000\n }', ...} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSStyleRule' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError _________________________ TestCSSStyleRule.test_style __________________________ self = <cssutils.tests.test_cssstylerule.TestCSSStyleRule object at 0x7f35b96f5250> def test_style(self): "CSSStyleRule.style" d = cssutils.css.CSSStyleDeclaration() > self.r.style = d E AttributeError: 'TestCSSStyleRule' object has no attribute 'r' cssutils/tests/test_cssstylerule.py:197: AttributeError _________________________ TestCSSStyleSheet.test_init __________________________ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b97ea8d0> def test_init(self): "CSSStyleSheet.__init__()" > assert 'text/css' == self.s.type E AttributeError: 'TestCSSStyleSheet' object has no attribute 's' cssutils/tests/test_cssstylesheet.py:20: AttributeError ________________________ TestCSSStyleSheet.test_cssText ________________________ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b97e99d0> def test_cssText(self): "CSSStyleSheet.cssText" tests = { '': b'', # @charset '@charset "ascii";\n@import "x";': b'@charset "ascii";\n@import "x";', '@charset "ascii";\n@media all {}': b'@charset "ascii";', '@charset "ascii";\n@x;': b'@charset "ascii";\n@x;', '@charset "ascii";\na {\n x: 1\n }': b'@charset "ascii";\na {\n x: 1\n }', # @import '@x;\n@import "x";': b'@x;\n@import "x";', '@import "x";\n@import "y";': b'@import "x";\n@import "y";', '@import "x";\n@media all {}': b'@import "x";', '@import "x";\n@x;': b'@import "x";\n@x;', '@import "x";\na {\n x: 1\n }': b'@import "x";\na {\n x: 1\n }', # @namespace '@x;\n@namespace a "x";': b'@x;\n@namespace a "x";', '@namespace a "x";\n@namespace b "y";': b'@namespace a "x";\n@namespace b "y";', '@import "x";\n@namespace a "x";\n@media all {}': b'@import "x";\n@namespace a "x";', '@namespace a "x";\n@x;': b'@namespace a "x";\n@x;', '@namespace a "x";\na {\n x: 1\n }': b'@namespace a "x";\na {\n x: 1\n }', """@namespace url("e1"); @namespace url("e2"); @namespace x url("x1"); @namespace x url("x2"); test{color: green} x|test {color: green}""": b"""@namespace "e2"; @namespace x "x2"; test { color: green } x|test { color: green }""" # ur'\1 { \2: \3 }': ur'''\x01 { # \x02: \x03 # }''', # ur''' # \@ { \@: \@ } # \1 { \2: \3 } # \{{\::\;;} # ''': ur'''\@ { # \@: \@ # } # \1 { # \2: \3 # } # \{ # {\:: \; # }''' } > self.do_equal_r(tests) cssutils/tests/test_cssstylesheet.py:176: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b97e99d0> tests = {'': b'', '@charset "ascii";\n@import "x";': b'@charset "ascii";\n@import "x";', '@charset "ascii";\n@media all {}': b'@charset "ascii";', '@charset "ascii";\n@x;': b'@charset "ascii";\n@x;', ...} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSStyleSheet' object has no attribute 'r' cssutils/tests/basetest.py:41: AttributeError ______________ TestCSSStyleSheet.test_cssText_HierarchyRequestErr ______________ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b96d4d10> def test_cssText_HierarchyRequestErr(self): "CSSStyleSheet.cssText HierarchyRequestErr" tests = { # @charset: only one and always 1st ' @charset "utf-8";': xml.dom.HierarchyRequestErr, '@charset "ascii";@charset "ascii";': xml.dom.HierarchyRequestErr, '/*c*/@charset "ascii";': xml.dom.HierarchyRequestErr, '@import "x"; @charset "ascii";': xml.dom.HierarchyRequestErr, '@namespace a "x"; @charset "ascii";': xml.dom.HierarchyRequestErr, '@media all {} @charset "ascii";': xml.dom.HierarchyRequestErr, '@page {} @charset "ascii";': xml.dom.HierarchyRequestErr, 'a {} @charset "ascii";': xml.dom.HierarchyRequestErr, # @import: before @namespace, @media, @page, sr '@namespace a "x"; @import "x";': xml.dom.HierarchyRequestErr, '@media all {} @import "x";': xml.dom.HierarchyRequestErr, '@page {} @import "x";': xml.dom.HierarchyRequestErr, 'a {} @import "x";': xml.dom.HierarchyRequestErr, # @namespace: before @media, @page, sr '@media all {} @namespace a "x";': xml.dom.HierarchyRequestErr, '@page {} @namespace a "x";': xml.dom.HierarchyRequestErr, 'a {} @namespace a "x";': xml.dom.HierarchyRequestErr, } > self.do_raise_r(tests) cssutils/tests/test_cssstylesheet.py:257: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b96d4d10> tests = {' @charset "utf-8";': <class 'xml.dom.HierarchyRequestErr'>, '/*c*/@charset "ascii";': <class 'xml.dom.HierarchyReque...': <class 'xml.dom.HierarchyRequestErr'>, '@import "x"; @charset "ascii";': <class 'xml.dom.HierarchyRequestErr'>, ...} att = '_setCssText' def do_raise_r(self, tests, att='_setCssText'): # set self.r and expect raise for test, expected in tests.items(): with pytest.raises(expected): > self.r.__getattribute__(att)(test) E AttributeError: 'TestCSSStyleSheet' object has no attribute 'r' cssutils/tests/basetest.py:50: AttributeError ___________________ TestCSSStyleSheet.test_cssText_SyntaxErr ___________________ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b96d7ef0> def test_cssText_SyntaxErr(self): """CSSStyleSheet.cssText SyntaxErr for single {, } or ; """ tests = { '{': xml.dom.SyntaxErr, '}': xml.dom.SyntaxErr, ';': xml.dom.SyntaxErr, '@charset "ascii";{': xml.dom.SyntaxErr, '@charset "ascii";}': xml.dom.SyntaxErr, '@charset "ascii";;': xml.dom.SyntaxErr, } > self.do_raise_r(tests) cssutils/tests/test_cssstylesheet.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b96d7ef0> tests = {';': <class 'xml.dom.SyntaxErr'>, '@charset "ascii";;': <class 'xml.dom.SyntaxErr'>, '@charset "ascii";{': <class 'xml.dom.SyntaxErr'>, '@charset "ascii";}': <class 'xml.dom.SyntaxErr'>, ...} att = '_setCssText' def do_raise_r(self, tests, att='_setCssText'): # set self.r and expect raise for test, expected in tests.items(): with pytest.raises(expected): > self.r.__getattribute__(att)(test) E AttributeError: 'TestCSSStyleSheet' object has no attribute 'r' cssutils/tests/basetest.py:50: AttributeError _______________________ TestCSSStyleSheet.test_encoding ________________________ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b96d6d20> def test_encoding(self): "CSSStyleSheet.encoding" > self.s.cssText = '' E AttributeError: 'TestCSSStyleSheet' object has no attribute 's' cssutils/tests/test_cssstylesheet.py:278: AttributeError ____________________ TestCSSStyleSheet.test_deleteRuleIndex ____________________ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b96d4170> def test_deleteRuleIndex(self): "CSSStyleSheet.deleteRule(index)" > self.s.cssText = '@charset "ascii"; @import "x"; @x; a {\n x: 1\n }@y;' E AttributeError: 'TestCSSStyleSheet' object has no attribute 's' cssutils/tests/test_cssstylesheet.py:522: AttributeError _______________ TestCSSStyleSheet.test_NoModificationAllowedErr ________________ self = <cssutils.tests.test_cssstylesheet.TestCSSStyleSheet object at 0x7f35b96d6420> def test_NoModificationAllowedErr(self): "CSSStyleSheet NoModificationAllowedErr" css = cssutils.css.CSSStyleSheet(readonly=True) assert css._readonly # internal... with pytest.raises(xml.dom.NoModificationAllowedErr): css._setCssText('@x;') with pytest.raises(xml.dom.NoModificationAllowedErr): > css.insertRule(self.rule) E AttributeError: 'TestCSSStyleSheet' object has no attribute 'rule' cssutils/tests/test_cssstylesheet.py:870: AttributeError _________________________ TestCSSUnknownRule.test_init _________________________ self = <cssutils.tests.test_cssunknownrule.TestCSSUnknownRule object at 0x7f35b971cbc0> def test_init(self): "CSSUnknownRule.type and init" > super().test_init() cssutils/tests/test_cssunknownrule.py:20: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssunknownrule.TestCSSUnknownRule object at 0x7f35b971cbc0> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSUnknownRule' object has no attribute 'r_type' cssutils/tests/test_cssrule.py:43: AttributeError _______________________ TestCSSUnknownRule.test_cssText ________________________ self = <cssutils.tests.test_cssunknownrule.TestCSSUnknownRule object at 0x7f35b971a8a0> def test_cssText(self): "CSSUnknownRule.cssText" tests = { # not normal rules! '@font-facex{}': '@font-facex {\n }', '@importurl(x.css);': '@importurl (x . css);', '@mediaAll{}': '@mediaall {\n }', '@namespacep"x";': '@namespacep "x";', '@pageX{}': '@pagex {\n }', '@xbottom { content: counter(page) }': '@xbottom {\n content: counter(page)\n }', '@xbottom { content: "x" counter(page) "y"}': '@xbottom {\n content: "x" counter(page) "y"\n }', } self.do_equal_p(tests) # expects the same atkeyword for self.r so do a new one each test > oldr = self.r E AttributeError: 'TestCSSUnknownRule' object has no attribute 'r' cssutils/tests/test_cssunknownrule.py:74: AttributeError ________________ TestCSSUnknownRule.test_InvalidModificationErr ________________ self = <cssutils.tests.test_cssunknownrule.TestCSSUnknownRule object at 0x7f35b971a120> def test_InvalidModificationErr(self): "CSSUnknownRule.cssText InvalidModificationErr" > self._test_InvalidModificationErr('@unknown') cssutils/tests/test_cssunknownrule.py:133: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssunknownrule.TestCSSUnknownRule object at 0x7f35b971a120> startwithspace = '@unknown' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSUnknownRule' object has no attribute 'r' cssutils/tests/test_cssrule.py:244: AttributeError ___________________ TestCSSVariablesDeclaration.test_cssText ___________________ self = <cssutils.tests.test_cssvariablesdeclaration.TestCSSVariablesDeclaration object at 0x7f35b947e720> def test_cssText(self): "CSSVariablesDeclaration.cssText" # empty tests = { '': '', ' ': '', ' \t \n ': '', 'x: 1': None, 'x: "a"': None, 'x: rgb(1, 2, 3)': None, 'x: 1px 2px 3px': None, 'x:1': 'x: 1', 'x:1;': 'x: 1', 'x : 1 ': 'x: 1', 'x : 1 ; ': 'x: 1', 'x:1;y:2': 'x: 1;\ny: 2', 'x:1;y:2;': 'x: 1;\ny: 2', 'x : 1 ; y : 2 ': 'x: 1;\ny: 2', 'x : 1 ; y : 2 ; ': 'x: 1;\ny: 2', '/*x*/': '/*x*/', 'x555: 5': None, 'xxx:1;yyy:2': 'xxx: 1;\nyyy: 2', 'xxx : 1; yyy : 2': 'xxx: 1;\nyyy: 2', 'x:1;x:2;X:2': 'x: 2', 'same:1;SAME:2;': 'same: 2', '/**/x/**/:/**/1/**/;/**/y/**/:/**/2/**/': '/**/ \n /**/ \n /**/ \n x: 1 /**/;\n/**/ \n /**/ \n /**/ \n y: 2 /**/', } > self.do_equal_r(tests) /builddir/build/BUILD/cssutils-2.6.0/cssutils/tests/test_cssvariablesdeclaration.py:108: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssvariablesdeclaration.TestCSSVariablesDeclaration object at 0x7f35b947e720> tests = {'': '', ' ': '', ' \t \n ': '', '/**/x/**/:/**/1/**/;/**/y/**/:/**/2/**/': '/**/ \n /**/ \n /**/ \n x: 1 /**/;\n/**/ \n /**/ \n /**/ \n y: 2 /**/', ...} att = 'cssText' def do_equal_r(self, tests, att='cssText'): # set attribute att of self.r and assert Equal for test, expected in tests.items(): > self.r.__setattr__(att, test) E AttributeError: 'TestCSSVariablesDeclaration' object has no attribute 'r' /builddir/build/BUILD/cssutils-2.6.0/cssutils/tests/basetest.py:41: AttributeError ________________________ TestCSSVariablesRule.test_init ________________________ self = <cssutils.tests.test_cssvariablesrule.TestCSSVariablesRule object at 0x7f35b947eea0> def test_init(self): "CSSVariablesRule.__init__()" > super().test_init() /builddir/build/BUILD/cssutils-2.6.0/cssutils/tests/test_cssvariablesrule.py:20: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssvariablesrule.TestCSSVariablesRule object at 0x7f35b947eea0> def test_init(self): "CSSRule.type and init" > assert self.r_type == self.r.type E AttributeError: 'TestCSSVariablesRule' object has no attribute 'r_type' /builddir/build/BUILD/cssutils-2.6.0/cssutils/tests/test_cssrule.py:43: AttributeError _______________ TestCSSVariablesRule.test_InvalidModificationErr _______________ self = <cssutils.tests.test_cssvariablesrule.TestCSSVariablesRule object at 0x7f35b946d670> def test_InvalidModificationErr(self): "CSSVariablesRule.cssText InvalidModificationErr" > self._test_InvalidModificationErr('@variables') /builddir/build/BUILD/cssutils-2.6.0/cssutils/tests/test_cssvariablesrule.py:35: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <cssutils.tests.test_cssvariablesrule.TestCSSVariablesRule object at 0x7f35b946d670> startwithspace = '@variables' def _test_InvalidModificationErr(self, startwithspace): """ CSSRule.cssText InvalidModificationErr called by subclasses startwithspace for test starting with this not the test but " test" is tested e.g. " @page {}" exception is the style rule test """ tests = ( '', '/* comment */', '@charset "utf-8";', '@font-face {}', '@import url(x);', '@media all {}', '@namespace "x";' '@page {}', '@unknown;', '@variables;', # TODO: # u'@top-left {}' 'a style rule {}', ) for test in tests: if startwithspace in ('a style rule',) and test in ( '/* comment */', 'a style rule {}', ): continue if test.startswith(startwithspace): test = ' %s' % test with pytest.raises(xml.dom.InvalidModificationErr): > self.r._setCssText(test) E AttributeError: 'TestCSSVariablesRule' object has no attribute 'r' /builddir/build/BUILD/cssutils-2.6.0/cssutils/tests/test_cssrule.py:244: AttributeError https://docs.pytest.org/en/stable/changelog.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07247945-python-cssutils/ For all our attempts to build python-cssutils with pytest 8, see: https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/package/python-cssutils/ Let us know here if you have any questions. Pytest 8 is planned to be included in Fedora 41. And this bugzilla is a heads up before we merge new pytest into rawhide. For more info see a Fedora Change proposal https://fedoraproject.org/wiki/Changes/Pytest_8 We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
PR: https://src.fedoraproject.org/rpms/python-cssutils/pull-request/3