Coder Social home page Coder Social logo

cssutils's Introduction

tests Ruff https://readthedocs.org/projects/cssutils/badge/?version=latest https://img.shields.io/badge/skeleton-2024-informational https://tidelift.com/badges/package/pypi/cssutils

Overview

A Python package to parse and build CSS Cascading Style Sheets. DOM only, not any rendering facilities!

Based upon and partly implementing the following specifications :

CSS 2.1rev1
General CSS rules and properties are defined here
CSS3 Module: Syntax
Used in parts since cssutils 0.9.4. cssutils tries to use the features from CSS 2.1 and CSS 3 with preference to CSS3 but as this is not final yet some parts are from CSS 2.1
CSS Fonts Module Level 3
Added changes and additional stuff (since cssutils v0.9.6)
MediaQueries
MediaQueries are part of stylesheets.MediaList since v0.9.4, used in @import and @media rules.
Namespaces
Added in v0.9.1, updated to definition in CSSOM in v0.9.4, updated in 0.9.5 for dev version
CSS3 Module: Pages Media
Most properties of this spec are implemented including MarginRules
Selectors
The selector syntax defined here (and not in CSS 2.1) should be parsable with cssutils (should mind though ;) )
CSS Backgrounds and Borders Module Level 3, CSS3 Basic User Interface Module, CSS Text Level 3
Some validation for properties included, mainly cursor, outline, resize, box-shadow, text-shadow
Variables / CSS Custom Properties
Experimental specification of CSS Variables which cssutils implements partly. The vars defined in the newer CSS Custom Properties spec should in main parts be at least parsable with cssutils.
DOM Level 2 Style CSS
DOM for package css. 0.9.8 removes support for CSSValue and related API, see PropertyValue and Value API for now
DOM Level 2 Style Stylesheets
DOM for package stylesheets
CSSOM
A few details (mainly the NamespaceRule DOM) are taken from here. Plan is to move implementation to the stuff defined here which is newer but still no REC so might change anytime...

The cssutils tokenizer is a customized implementation of CSS3 Module: Syntax (W3C Working Draft 13 August 2003) which itself is based on the CSS 2.1 tokenizer. It tries to be as compliant as possible but uses some (helpful) parts of the CSS 2.1 tokenizer.

I guess cssutils is neither CSS 2.1 nor CSS 3 compliant but tries to at least be able to parse both grammars including some more real world cases (some CSS hacks are actually parsed and serialized). Both official grammars are not final nor bugfree but still feasible. cssutils aim is not to be fully compliant to any CSS specification (the specifications seem to be in a constant flow anyway) but cssutils should be able to read and write as many as possible CSS stylesheets "in the wild" while at the same time implement the official APIs which are well documented. Some minor extensions are provided as well.

Compatibility

cssutils is developed on modern Python versions. Check the package metadata for compatibilty.

Beware, cssutils is known to be thread unsafe.

Example

import cssutils

css = '''/* a comment with umlaut ä */
     @namespace html "http://www.w3.org/1999/xhtml";
     @variables { BG: #fff }
     html|a { color:red; background: var(BG) }'''
sheet = cssutils.parseString(css)

for rule in sheet:
    if rule.type == rule.STYLE_RULE:
        # find property
        for property in rule.style:
            if property.name == 'color':
                property.value = 'green'
                property.priority = 'IMPORTANT'
                break
        # or simply:
        rule.style['margin'] = '01.0eM' # or: ('1em', 'important')

sheet.encoding = 'ascii'
sheet.namespaces['xhtml'] = 'http://www.w3.org/1999/xhtml'
sheet.namespaces['atom'] = 'http://www.w3.org/2005/Atom'
sheet.add('atom|title {color: #000000 !important}')
sheet.add('@import "sheets/import.css";')

# cssutils.ser.prefs.resolveVariables == True since 0.9.7b2
print sheet.cssText

results in:

@charset "ascii";
@import "sheets/import.css";
/* a comment with umlaut \E4  */
@namespace xhtml "http://www.w3.org/1999/xhtml";
@namespace atom "http://www.w3.org/2005/Atom";
xhtml|a {
    color: green !important;
    background: #fff;
    margin: 1em
    }
atom|title {
    color: #000 !important
    }

Kind Request

cssutils is far from being perfect or even complete. If you find any bugs (especially specification violations) or have problems or suggestions please put them in the Issue Tracker.

Thanks

Special thanks to Christof Höke for seminal creation of the library.

Thanks to Simon Sapin, Jason R. Coombs, and Walter Doerwald for patches, help and discussion. Thanks to Kevin D. Smith for the value validating module. Thanks also to Cory Dodt, Tim Gerla, James Dobson and Amit Moscovich for helpful suggestions and code patches. Thanks to Fredrik Hedman for help on port of encutils to Python 3.

For Enterprise

Available as part of the Tidelift Subscription.

This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.

Learn more.

cssutils's People

Contributors

aalebedev avatar abravalheri avatar apn-pucky avatar arthurzam avatar avasam avatar bhrutledge avatar bswck avatar cclauss avatar cthedot avatar darkvertex avatar denik avatar dimitripapadopoulos avatar dotlambda avatar floppym avatar hrnciar avatar hugovk avatar jaraco avatar joycebrum avatar kolanich avatar mgorny avatar simonsapin avatar terukizm avatar vekhir avatar webknjaz avatar wimglenn avatar zacharyburnett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cssutils's Issues

Incorrect handling of @font-face nested in conditional At-rules (@media)

According to MDN's documentation on At-Rules Nesting, @font-face is allowed to be nested within conditional At-Rules such as @media but this library flags that as an error and strips it from the source CSS during parsing in these 2 spots:

  1. factories = {
    '@page': cssutils.css.CSSPageRule,
    '@media': CSSMediaRule,
    }
    if atval in (
    '@charset ',
    '@font-face',
    '@import',
    '@namespace',
    '@variables',
    ):
    self._log.error(
    'CSSMediaRule: This rule is not '
    'allowed in CSSMediaRule - ignored: '
    '%s.' % self._valuestr(tokens),
    token=token,
    error=xml.dom.HierarchyRequestErr,
    )
  2. if (
    isinstance(rule, cssutils.css.CSSCharsetRule)
    or isinstance(rule, cssutils.css.CSSFontFaceRule)
    or isinstance(rule, cssutils.css.CSSImportRule)
    or isinstance(rule, cssutils.css.CSSNamespaceRule)
    or isinstance(rule, cssutils.css.MarginRule)
    ):
    self._log.error(
    '%s: This type of rule is not allowed here: %s'
    % (self.__class__.__name__, rule.cssText),
    error=xml.dom.HierarchyRequestErr,
    )
    return

Found this out while parsing <style> tags from ConstantContact's email template previews to minify the CSS because they appear to use nested rules like this:

@media screen {
    @font-face{
        font-family: "Open Sans";
        font-style: normal;
        font-weight: 400;
        src: local("Open Sans Regular"), local("OpenSans-Regular"), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) format("woff2");
        unicode-range: u+0000-00ff,u+0131,u+0152-0153,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2212,u+2215;
    }
    @font-face{
        font-family: "Merriweather";
        font-style: normal;
        font-weight: 400;
        src: local("Merriweather Regular"), local("Merriweather-Regular"), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-fCZMdeX3rg.woff2) format("woff2");
        unicode-range: u+0000-00ff,u+0131,u+0152-0153,u+02c6,u+02da,u+02dc,u+2000-206f,u+2074,u+20ac,u+2212,u+2215;
    }
}

Errors:

ERROR   CSSMediaRule: This rule is not allowed in CSSMediaRule - ignored: @font-face { font-family: 'Open Sans'; font-style: normal; font-weight: 400; src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; }. [6:18: @font-face]
ERROR   CSSMediaRule: This rule is not allowed in CSSMediaRule - ignored: @font-face { font-family: 'Merriweather'; font-style: normal; font-weight: 400; src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-fCZMdeX3rg.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; }. [6:376: @font-face]

Dependent encutils will not work in Python 3.13

encutils is too old and doesn't look like it's being maintained, so consider switching to another library

encutils/__init__.py:55: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Support Python 3 natively

The current codebase in based on Python 2 and relies on lib2to3 to convert to Python 3 compatible syntax. Let's abandon that and support Python 3 natively.

CSSUTILS logger overrides existing config on import

Hi!

On first import of cssutils, the 'CSSUTILS' logger is set up and configured with some default values, as can be seen here:
https://github.com/jaraco/cssutils/blob/main/cssutils/errorhandler.py#L51-L56

This can lead to issues if your import of cssutils happens later than your main logging config setup, since it will override whatever is already configured. To avoid it, you must pre-emptively import cssutils before your own logging config.

It would be easier if cssutils detected if the logger has already been set up, and didn't add it's own default config in that case. At the very least, if it preserved the loglevel the user has selected that would help.

Problem to install python-cssutils with yay -S python-cssutils

 yay -S python-cssutils
AUR Explicit (1): python-cssutils-2.9.0-1
:: PKGBUILD up to date, skipping download: python-cssutils
  1 python-cssutils                  (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> N
  1 python-cssutils                  (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> N
==> Making package: python-cssutils 2.9.0-1 (Sat 23 Mar 2024 10:02:40 PM -05)
==> Retrieving sources...
  -> Found cssutils-2.9.0.tar.gz
==> WARNING: Skipping verification of source file PGP signatures.
==> Validating source files with sha256sums...
    cssutils-2.9.0.tar.gz ... Passed
:: (1/1) Parsing SRCINFO: python-cssutils
==> Making package: python-cssutils 2.9.0-1 (Sat 23 Mar 2024 10:02:41 PM -05)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found cssutils-2.9.0.tar.gz
==> Validating source files with sha256sums...
    cssutils-2.9.0.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting cssutils-2.9.0.tar.gz with bsdtar
==> Sources are ready.
==> Making package: python-cssutils 2.9.0-1 (Sat 23 Mar 2024 10:02:43 PM -05)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Starting build()...
* Getting build dependencies for wheel...
running egg_info
writing cssutils.egg-info/PKG-INFO
writing dependency_links to cssutils.egg-info/dependency_links.txt
writing entry points to cssutils.egg-info/entry_points.txt
writing requirements to cssutils.egg-info/requires.txt
writing top-level names to cssutils.egg-info/top_level.txt
reading manifest file 'cssutils.egg-info/SOURCES.txt'
adding license file 'COPYING'
adding license file 'COPYING.LESSER'
writing manifest file 'cssutils.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/cssutils
copying cssutils/serialize.py -> build/lib/cssutils
copying cssutils/errorhandler.py -> build/lib/cssutils
copying cssutils/sac.py -> build/lib/cssutils
copying cssutils/_fetch.py -> build/lib/cssutils
copying cssutils/profiles.py -> build/lib/cssutils
copying cssutils/settings.py -> build/lib/cssutils
copying cssutils/tokenize2.py -> build/lib/cssutils
copying cssutils/parse.py -> build/lib/cssutils
copying cssutils/util.py -> build/lib/cssutils
copying cssutils/cssproductions.py -> build/lib/cssutils
copying cssutils/__init__.py -> build/lib/cssutils
copying cssutils/prodparser.py -> build/lib/cssutils
copying cssutils/script.py -> build/lib/cssutils
copying cssutils/codec.py -> build/lib/cssutils
copying cssutils/helper.py -> build/lib/cssutils
copying cssutils/css2productions.py -> build/lib/cssutils
copying cssutils/_fetchgae.py -> build/lib/cssutils
creating build/lib/encutils
copying encutils/__init__.py -> build/lib/encutils
creating build/lib/cssutils/tests
copying cssutils/tests/test_cssrule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssvalue.py -> build/lib/cssutils/tests
copying cssutils/tests/test_helper.py -> build/lib/cssutils/tests
copying cssutils/tests/test_profiles.py -> build/lib/cssutils/tests
copying cssutils/tests/basetest.py -> build/lib/cssutils/tests
copying cssutils/tests/test_property.py -> build/lib/cssutils/tests
copying cssutils/tests/test_util.py -> build/lib/cssutils/tests
copying cssutils/tests/test_csscomment.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssvariablesdeclaration.py -> build/lib/cssutils/tests
copying cssutils/tests/test_prodparser.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssstyledeclaration.py -> build/lib/cssutils/tests
copying cssutils/tests/test_csspagerule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssproperties.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssrulelist.py -> build/lib/cssutils/tests
copying cssutils/tests/test_medialist.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssfontfacerule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssunknownrule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_domimplementation.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssutilsimport.py -> build/lib/cssutils/tests
copying cssutils/tests/test_properties.py -> build/lib/cssutils/tests
copying cssutils/tests/test_errorhandler.py -> build/lib/cssutils/tests
copying cssutils/tests/test_scripts_csscombine.py -> build/lib/cssutils/tests
copying cssutils/tests/test_csscharsetrule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_encutils.py -> build/lib/cssutils/tests
copying cssutils/tests/__init__.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssstylerule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_mediaquery.py -> build/lib/cssutils/tests
copying cssutils/tests/test_tokenize2.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssimportrule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_settings.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssstylesheet.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssmediarule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_x.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssvariablesrule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_marginrule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssnamespacerule.py -> build/lib/cssutils/tests
copying cssutils/tests/test_codec.py -> build/lib/cssutils/tests
copying cssutils/tests/test_serialize.py -> build/lib/cssutils/tests
copying cssutils/tests/test_value.py -> build/lib/cssutils/tests
copying cssutils/tests/test_parse.py -> build/lib/cssutils/tests
copying cssutils/tests/test_stylesheet.py -> build/lib/cssutils/tests
copying cssutils/tests/test_cssutils.py -> build/lib/cssutils/tests
copying cssutils/tests/test_selectorlist.py -> build/lib/cssutils/tests
copying cssutils/tests/test_selector.py -> build/lib/cssutils/tests
creating build/lib/cssutils/scripts
copying cssutils/scripts/csscombine.py -> build/lib/cssutils/scripts
copying cssutils/scripts/csscapture.py -> build/lib/cssutils/scripts
copying cssutils/scripts/__init__.py -> build/lib/cssutils/scripts
copying cssutils/scripts/cssparse.py -> build/lib/cssutils/scripts
creating build/lib/cssutils/css
copying cssutils/css/colors.py -> build/lib/cssutils/css
copying cssutils/css/cssnamespacerule.py -> build/lib/cssutils/css
copying cssutils/css/csscomment.py -> build/lib/cssutils/css
copying cssutils/css/cssvariablesrule.py -> build/lib/cssutils/css
copying cssutils/css/cssproperties.py -> build/lib/cssutils/css
copying cssutils/css/value.py -> build/lib/cssutils/css
copying cssutils/css/cssunknownrule.py -> build/lib/cssutils/css
copying cssutils/css/selectorlist.py -> build/lib/cssutils/css
copying cssutils/css/marginrule.py -> build/lib/cssutils/css
copying cssutils/css/cssstylesheet.py -> build/lib/cssutils/css
copying cssutils/css/csscharsetrule.py -> build/lib/cssutils/css
copying cssutils/css/cssstyledeclaration.py -> build/lib/cssutils/css
copying cssutils/css/cssrulelist.py -> build/lib/cssutils/css
copying cssutils/css/cssrule.py -> build/lib/cssutils/css
copying cssutils/css/selector.py -> build/lib/cssutils/css
copying cssutils/css/cssvalue.py -> build/lib/cssutils/css
copying cssutils/css/cssimportrule.py -> build/lib/cssutils/css
copying cssutils/css/__init__.py -> build/lib/cssutils/css
copying cssutils/css/cssmediarule.py -> build/lib/cssutils/css
copying cssutils/css/cssfontfacerule.py -> build/lib/cssutils/css
copying cssutils/css/csspagerule.py -> build/lib/cssutils/css
copying cssutils/css/property.py -> build/lib/cssutils/css
copying cssutils/css/cssvariablesdeclaration.py -> build/lib/cssutils/css
copying cssutils/css/cssstylerule.py -> build/lib/cssutils/css
creating build/lib/cssutils/stylesheets
copying cssutils/stylesheets/stylesheet.py -> build/lib/cssutils/stylesheets
copying cssutils/stylesheets/stylesheetlist.py -> build/lib/cssutils/stylesheets
copying cssutils/stylesheets/__init__.py -> build/lib/cssutils/stylesheets
copying cssutils/stylesheets/mediaquery.py -> build/lib/cssutils/stylesheets
copying cssutils/stylesheets/medialist.py -> build/lib/cssutils/stylesheets
running egg_info
writing cssutils.egg-info/PKG-INFO
writing dependency_links to cssutils.egg-info/dependency_links.txt
writing entry points to cssutils.egg-info/entry_points.txt
writing requirements to cssutils.egg-info/requires.txt
writing top-level names to cssutils.egg-info/top_level.txt
reading manifest file 'cssutils.egg-info/SOURCES.txt'
adding license file 'COPYING'
adding license file 'COPYING.LESSER'
writing manifest file 'cssutils.egg-info/SOURCES.txt'
creating build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/096.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/097.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/1.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/1ascii.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/1import.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/1inherit-ascii.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/1inherit-iso.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/1inherit-utf8.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/1utf.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/2inherit-iso.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/2resolve.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/acid2.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/all.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/atrule.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/bad.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/basic.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/bundle.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/cases.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/csscombine-1.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/csscombine-2.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/csscombine-proxy.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/cthedot_default.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/default_html4.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/hacks.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/html.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/html20.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/html40.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/import.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/import3.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/ll.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/ll2.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/multiple-values.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/page_test.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/sample_5.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/sample_7.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/simple.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/single-color.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/slashcode.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/t-HACKS.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/test-unicode.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/test.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/tigris.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/tigris2.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/u_simple.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/v_simple.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/vars.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/varsimport.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/xhtml2.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/xhtml22.css -> build/lib/cssutils/tests/sheets
copying cssutils/tests/sheets/yuck.css -> build/lib/cssutils/tests/sheets
creating build/lib/cssutils/tests/sheets/import
copying cssutils/tests/sheets/import/import-impossible.css -> build/lib/cssutils/tests/sheets/import
copying cssutils/tests/sheets/import/import2.css -> build/lib/cssutils/tests/sheets/import
creating build/lib/cssutils/tests/sheets/var
copying cssutils/tests/sheets/var/start.css -> build/lib/cssutils/tests/sheets/var
copying cssutils/tests/sheets/var/use.css -> build/lib/cssutils/tests/sheets/var
copying cssutils/tests/sheets/var/vars.css -> build/lib/cssutils/tests/sheets/var
copying cssutils/tests/sheets/var/vars2.css -> build/lib/cssutils/tests/sheets/var
creating build/lib/cssutils/tests/sheets/images
copying cssutils/tests/sheets/images/example.gif -> build/lib/cssutils/tests/sheets/images
creating build/lib/cssutils/tests/sheets/import/images2
copying cssutils/tests/sheets/import/images2/example2.gif -> build/lib/cssutils/tests/sheets/import/images2
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/serialize.py -> build/bdist.linux-x86_64/wheel/cssutils
creating build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssrule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssvalue.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_helper.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_profiles.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/basetest.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_property.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_util.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_csscomment.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssvariablesdeclaration.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_prodparser.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssstyledeclaration.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_csspagerule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssproperties.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssrulelist.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_medialist.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssfontfacerule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssunknownrule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_domimplementation.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssutilsimport.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_properties.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_errorhandler.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_scripts_csscombine.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_csscharsetrule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_encutils.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/__init__.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssstylerule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_mediaquery.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
creating build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/cases.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/default_html4.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/ll2.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/sample_7.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/2inherit-iso.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/single-color.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/xhtml2.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/multiple-values.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/basic.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/097.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/acid2.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/tigris2.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/import.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/simple.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/ll.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/1.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/xhtml22.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/varsimport.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/bad.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/import3.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/cthedot_default.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/1import.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/csscombine-1.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/sample_5.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/tigris.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/csscombine-2.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/u_simple.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/test-unicode.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/yuck.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/t-HACKS.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
creating build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/import
creating build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/import/images2
copying build/lib/cssutils/tests/sheets/import/images2/example2.gif -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/import/images2
copying build/lib/cssutils/tests/sheets/import/import2.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/import
copying build/lib/cssutils/tests/sheets/import/import-impossible.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/import
copying build/lib/cssutils/tests/sheets/hacks.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/1inherit-ascii.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/test.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/slashcode.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/vars.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/all.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/2resolve.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/1inherit-iso.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/html.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/1inherit-utf8.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/bundle.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
creating build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/var
copying build/lib/cssutils/tests/sheets/var/vars2.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/var
copying build/lib/cssutils/tests/sheets/var/start.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/var
copying build/lib/cssutils/tests/sheets/var/use.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/var
copying build/lib/cssutils/tests/sheets/var/vars.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/var
copying build/lib/cssutils/tests/sheets/atrule.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/html20.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/1utf.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
creating build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/images
copying build/lib/cssutils/tests/sheets/images/example.gif -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets/images
copying build/lib/cssutils/tests/sheets/page_test.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/html40.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/1ascii.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/csscombine-proxy.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/v_simple.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/sheets/096.css -> build/bdist.linux-x86_64/wheel/cssutils/tests/sheets
copying build/lib/cssutils/tests/test_tokenize2.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssimportrule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_settings.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssstylesheet.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssmediarule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_x.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssvariablesrule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_marginrule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssnamespacerule.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_codec.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_serialize.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_value.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_parse.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_stylesheet.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_cssutils.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_selectorlist.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/tests/test_selector.py -> build/bdist.linux-x86_64/wheel/cssutils/tests
copying build/lib/cssutils/errorhandler.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/sac.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/_fetch.py -> build/bdist.linux-x86_64/wheel/cssutils
creating build/bdist.linux-x86_64/wheel/cssutils/scripts
copying build/lib/cssutils/scripts/csscombine.py -> build/bdist.linux-x86_64/wheel/cssutils/scripts
copying build/lib/cssutils/scripts/csscapture.py -> build/bdist.linux-x86_64/wheel/cssutils/scripts
copying build/lib/cssutils/scripts/__init__.py -> build/bdist.linux-x86_64/wheel/cssutils/scripts
copying build/lib/cssutils/scripts/cssparse.py -> build/bdist.linux-x86_64/wheel/cssutils/scripts
copying build/lib/cssutils/profiles.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/settings.py -> build/bdist.linux-x86_64/wheel/cssutils
creating build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/colors.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssnamespacerule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/csscomment.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssvariablesrule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssproperties.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/value.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssunknownrule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/selectorlist.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/marginrule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssstylesheet.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/csscharsetrule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssstyledeclaration.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssrulelist.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssrule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/selector.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssvalue.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssimportrule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/__init__.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssmediarule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssfontfacerule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/csspagerule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/property.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssvariablesdeclaration.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/css/cssstylerule.py -> build/bdist.linux-x86_64/wheel/cssutils/css
copying build/lib/cssutils/tokenize2.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/parse.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/util.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/cssproductions.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/__init__.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/prodparser.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/script.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/codec.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/helper.py -> build/bdist.linux-x86_64/wheel/cssutils
creating build/bdist.linux-x86_64/wheel/cssutils/stylesheets
copying build/lib/cssutils/stylesheets/stylesheet.py -> build/bdist.linux-x86_64/wheel/cssutils/stylesheets
copying build/lib/cssutils/stylesheets/stylesheetlist.py -> build/bdist.linux-x86_64/wheel/cssutils/stylesheets
copying build/lib/cssutils/stylesheets/__init__.py -> build/bdist.linux-x86_64/wheel/cssutils/stylesheets
copying build/lib/cssutils/stylesheets/mediaquery.py -> build/bdist.linux-x86_64/wheel/cssutils/stylesheets
copying build/lib/cssutils/stylesheets/medialist.py -> build/bdist.linux-x86_64/wheel/cssutils/stylesheets
copying build/lib/cssutils/css2productions.py -> build/bdist.linux-x86_64/wheel/cssutils
copying build/lib/cssutils/_fetchgae.py -> build/bdist.linux-x86_64/wheel/cssutils
creating build/bdist.linux-x86_64/wheel/encutils
copying build/lib/encutils/__init__.py -> build/bdist.linux-x86_64/wheel/encutils
running install_egg_info
Copying cssutils.egg-info to build/bdist.linux-x86_64/wheel/cssutils-2.9.0-py3.11.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/cssutils-2.9.0.dist-info/WHEEL
creating '/home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0/dist/.tmp-irvsuo4m/cssutils-2.9.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'cssutils/__init__.py'
adding 'cssutils/_fetch.py'
adding 'cssutils/_fetchgae.py'
adding 'cssutils/codec.py'
adding 'cssutils/css2productions.py'
adding 'cssutils/cssproductions.py'
adding 'cssutils/errorhandler.py'
adding 'cssutils/helper.py'
adding 'cssutils/parse.py'
adding 'cssutils/prodparser.py'
adding 'cssutils/profiles.py'
adding 'cssutils/sac.py'
adding 'cssutils/script.py'
adding 'cssutils/serialize.py'
adding 'cssutils/settings.py'
adding 'cssutils/tokenize2.py'
adding 'cssutils/util.py'
adding 'cssutils/css/__init__.py'
adding 'cssutils/css/colors.py'
adding 'cssutils/css/csscharsetrule.py'
adding 'cssutils/css/csscomment.py'
adding 'cssutils/css/cssfontfacerule.py'
adding 'cssutils/css/cssimportrule.py'
adding 'cssutils/css/cssmediarule.py'
adding 'cssutils/css/cssnamespacerule.py'
adding 'cssutils/css/csspagerule.py'
adding 'cssutils/css/cssproperties.py'
adding 'cssutils/css/cssrule.py'
adding 'cssutils/css/cssrulelist.py'
adding 'cssutils/css/cssstyledeclaration.py'
adding 'cssutils/css/cssstylerule.py'
adding 'cssutils/css/cssstylesheet.py'
adding 'cssutils/css/cssunknownrule.py'
adding 'cssutils/css/cssvalue.py'
adding 'cssutils/css/cssvariablesdeclaration.py'
adding 'cssutils/css/cssvariablesrule.py'
adding 'cssutils/css/marginrule.py'
adding 'cssutils/css/property.py'
adding 'cssutils/css/selector.py'
adding 'cssutils/css/selectorlist.py'
adding 'cssutils/css/value.py'
adding 'cssutils/scripts/__init__.py'
adding 'cssutils/scripts/csscapture.py'
adding 'cssutils/scripts/csscombine.py'
adding 'cssutils/scripts/cssparse.py'
adding 'cssutils/stylesheets/__init__.py'
adding 'cssutils/stylesheets/medialist.py'
adding 'cssutils/stylesheets/mediaquery.py'
adding 'cssutils/stylesheets/stylesheet.py'
adding 'cssutils/stylesheets/stylesheetlist.py'
adding 'cssutils/tests/__init__.py'
adding 'cssutils/tests/basetest.py'
adding 'cssutils/tests/test_codec.py'
adding 'cssutils/tests/test_csscharsetrule.py'
adding 'cssutils/tests/test_csscomment.py'
adding 'cssutils/tests/test_cssfontfacerule.py'
adding 'cssutils/tests/test_cssimportrule.py'
adding 'cssutils/tests/test_cssmediarule.py'
adding 'cssutils/tests/test_cssnamespacerule.py'
adding 'cssutils/tests/test_csspagerule.py'
adding 'cssutils/tests/test_cssproperties.py'
adding 'cssutils/tests/test_cssrule.py'
adding 'cssutils/tests/test_cssrulelist.py'
adding 'cssutils/tests/test_cssstyledeclaration.py'
adding 'cssutils/tests/test_cssstylerule.py'
adding 'cssutils/tests/test_cssstylesheet.py'
adding 'cssutils/tests/test_cssunknownrule.py'
adding 'cssutils/tests/test_cssutils.py'
adding 'cssutils/tests/test_cssutilsimport.py'
adding 'cssutils/tests/test_cssvalue.py'
adding 'cssutils/tests/test_cssvariablesdeclaration.py'
adding 'cssutils/tests/test_cssvariablesrule.py'
adding 'cssutils/tests/test_domimplementation.py'
adding 'cssutils/tests/test_encutils.py'
adding 'cssutils/tests/test_errorhandler.py'
adding 'cssutils/tests/test_helper.py'
adding 'cssutils/tests/test_marginrule.py'
adding 'cssutils/tests/test_medialist.py'
adding 'cssutils/tests/test_mediaquery.py'
adding 'cssutils/tests/test_parse.py'
adding 'cssutils/tests/test_prodparser.py'
adding 'cssutils/tests/test_profiles.py'
adding 'cssutils/tests/test_properties.py'
adding 'cssutils/tests/test_property.py'
adding 'cssutils/tests/test_scripts_csscombine.py'
adding 'cssutils/tests/test_selector.py'
adding 'cssutils/tests/test_selectorlist.py'
adding 'cssutils/tests/test_serialize.py'
adding 'cssutils/tests/test_settings.py'
adding 'cssutils/tests/test_stylesheet.py'
adding 'cssutils/tests/test_tokenize2.py'
adding 'cssutils/tests/test_util.py'
adding 'cssutils/tests/test_value.py'
adding 'cssutils/tests/test_x.py'
adding 'cssutils/tests/sheets/096.css'
adding 'cssutils/tests/sheets/097.css'
adding 'cssutils/tests/sheets/1.css'
adding 'cssutils/tests/sheets/1ascii.css'
adding 'cssutils/tests/sheets/1import.css'
adding 'cssutils/tests/sheets/1inherit-ascii.css'
adding 'cssutils/tests/sheets/1inherit-iso.css'
adding 'cssutils/tests/sheets/1inherit-utf8.css'
adding 'cssutils/tests/sheets/1utf.css'
adding 'cssutils/tests/sheets/2inherit-iso.css'
adding 'cssutils/tests/sheets/2resolve.css'
adding 'cssutils/tests/sheets/acid2.css'
adding 'cssutils/tests/sheets/all.css'
adding 'cssutils/tests/sheets/atrule.css'
adding 'cssutils/tests/sheets/bad.css'
adding 'cssutils/tests/sheets/basic.css'
adding 'cssutils/tests/sheets/bundle.css'
adding 'cssutils/tests/sheets/cases.css'
adding 'cssutils/tests/sheets/csscombine-1.css'
adding 'cssutils/tests/sheets/csscombine-2.css'
adding 'cssutils/tests/sheets/csscombine-proxy.css'
adding 'cssutils/tests/sheets/cthedot_default.css'
adding 'cssutils/tests/sheets/default_html4.css'
adding 'cssutils/tests/sheets/hacks.css'
adding 'cssutils/tests/sheets/html.css'
adding 'cssutils/tests/sheets/html20.css'
adding 'cssutils/tests/sheets/html40.css'
adding 'cssutils/tests/sheets/import.css'
adding 'cssutils/tests/sheets/import3.css'
adding 'cssutils/tests/sheets/ll.css'
adding 'cssutils/tests/sheets/ll2.css'
adding 'cssutils/tests/sheets/multiple-values.css'
adding 'cssutils/tests/sheets/page_test.css'
adding 'cssutils/tests/sheets/sample_5.css'
adding 'cssutils/tests/sheets/sample_7.css'
adding 'cssutils/tests/sheets/simple.css'
adding 'cssutils/tests/sheets/single-color.css'
adding 'cssutils/tests/sheets/slashcode.css'
adding 'cssutils/tests/sheets/t-HACKS.css'
adding 'cssutils/tests/sheets/test-unicode.css'
adding 'cssutils/tests/sheets/test.css'
adding 'cssutils/tests/sheets/tigris.css'
adding 'cssutils/tests/sheets/tigris2.css'
adding 'cssutils/tests/sheets/u_simple.css'
adding 'cssutils/tests/sheets/v_simple.css'
adding 'cssutils/tests/sheets/vars.css'
adding 'cssutils/tests/sheets/varsimport.css'
adding 'cssutils/tests/sheets/xhtml2.css'
adding 'cssutils/tests/sheets/xhtml22.css'
adding 'cssutils/tests/sheets/yuck.css'
adding 'cssutils/tests/sheets/images/example.gif'
adding 'cssutils/tests/sheets/import/import-impossible.css'
adding 'cssutils/tests/sheets/import/import2.css'
adding 'cssutils/tests/sheets/import/images2/example2.gif'
adding 'cssutils/tests/sheets/var/start.css'
adding 'cssutils/tests/sheets/var/use.css'
adding 'cssutils/tests/sheets/var/vars.css'
adding 'cssutils/tests/sheets/var/vars2.css'
adding 'encutils/__init__.py'
adding 'cssutils-2.9.0.dist-info/COPYING'
adding 'cssutils-2.9.0.dist-info/COPYING.LESSER'
adding 'cssutils-2.9.0.dist-info/METADATA'
adding 'cssutils-2.9.0.dist-info/WHEEL'
adding 'cssutils-2.9.0.dist-info/entry_points.txt'
adding 'cssutils-2.9.0.dist-info/top_level.txt'
adding 'cssutils-2.9.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built cssutils-2.9.0-py3-none-any.whl
==> Starting check()...
======================================= test session starts =======================================
platform linux -- Python 3.11.8, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0
configfile: pytest.ini
plugins: jaraco.test-5.4.0
collected 444 items                                                                               

cssutils/tests/test_codec.py ......                                                         [  1%]
cssutils/tests/test_csscharsetrule.py ..........                                            [  3%]
cssutils/tests/test_csscomment.py .......                                                   [  5%]
cssutils/tests/test_cssfontfacerule.py ...........                                          [  7%]
cssutils/tests/test_cssimportrule.py ..............                                         [ 10%]
cssutils/tests/test_cssmediarule.py .................                                       [ 14%]
cssutils/tests/test_cssnamespacerule.py ..........                                          [ 16%]
cssutils/tests/test_csspagerule.py ..............                                           [ 20%]
cssutils/tests/test_cssproperties.py ...                                                    [ 20%]
cssutils/tests/test_cssrule.py ....                                                         [ 21%]
cssutils/tests/test_cssrulelist.py ..                                                       [ 22%]
cssutils/tests/test_cssstyledeclaration.py ........................                         [ 27%]
cssutils/tests/test_cssstylerule.py ............                                            [ 30%]
cssutils/tests/test_cssstylesheet.py ............................                           [ 36%]
cssutils/tests/test_cssunknownrule.py .......                                               [ 38%]
cssutils/tests/test_cssutils.py ........                                                    [ 39%]
cssutils/tests/test_cssutilsimport.py .                                                     [ 40%]
cssutils/tests/test_cssvalue.py xxxxXxxxxxxxxxxxxxxxx                                       [ 44%]
cssutils/tests/test_cssvariablesdeclaration.py .........                                    [ 46%]
cssutils/tests/test_cssvariablesrule.py ..........                                          [ 49%]
cssutils/tests/test_domimplementation.py FFFF                                               [ 50%]
cssutils/tests/test_encutils.py .......                                                     [ 51%]
cssutils/tests/test_errorhandler.py ....                                                    [ 52%]
cssutils/tests/test_helper.py .....                                                         [ 53%]
cssutils/tests/test_marginrule.py ........                                                  [ 55%]
cssutils/tests/test_medialist.py .........                                                  [ 57%]
cssutils/tests/test_mediaquery.py ....                                                      [ 58%]
cssutils/tests/test_parse.py ..............                                                 [ 61%]
cssutils/tests/test_prodparser.py .................                                         [ 65%]
cssutils/tests/test_profiles.py ........xxxxxx.............xxxxx                            [ 72%]
cssutils/tests/test_properties.py ..                                                        [ 72%]
cssutils/tests/test_property.py ........                                                    [ 74%]
cssutils/tests/test_scripts_csscombine.py ..                                                [ 75%]
cssutils/tests/test_selector.py ........                                                    [ 77%]
cssutils/tests/test_selectorlist.py .....                                                   [ 78%]
cssutils/tests/test_serialize.py .............................                              [ 84%]
cssutils/tests/test_settings.py .                                                           [ 84%]
cssutils/tests/test_stylesheet.py .                                                         [ 85%]
cssutils/tests/test_tokenize2.py .............                                              [ 88%]
cssutils/tests/test_util.py .....................                                           [ 92%]
cssutils/tests/test_value.py .F...................xxxxxxxxxx                                [ 99%]
cssutils/tests/test_x.py x                                                                  [100%]

============================================ FAILURES =============================================
_________________________ TestDOMImplementation.test_createCSSStyleSheet __________________________

self = <cssutils.tests.test_domimplementation.TestDOMImplementation object at 0x777e84baba10>

    def test_createCSSStyleSheet(self):
        "DOMImplementationCSS.createCSSStyleSheet()"
        title, media = 'Test Title', cssutils.stylesheets.MediaList('all')
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
>           sheet = self.domimpl.createCSSStyleSheet(title, media)
E           AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'

/home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0/cssutils/tests/test_domimplementation.py:19: AttributeError
____________________________ TestDOMImplementation.test_createDocument ____________________________

self = <cssutils.tests.test_domimplementation.TestDOMImplementation object at 0x777e84ba9b50>

    def test_createDocument(self):
        "DOMImplementationCSS.createDocument()"
>       doc = self.domimpl.createDocument(None, None, None)
E       AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'

/home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0/cssutils/tests/test_domimplementation.py:26: AttributeError
__________________________ TestDOMImplementation.test_createDocumentType __________________________

self = <cssutils.tests.test_domimplementation.TestDOMImplementation object at 0x777e84babdd0>

    def test_createDocumentType(self):
        "DOMImplementationCSS.createDocumentType()"
>       doctype = self.domimpl.createDocumentType('foo', 'bar', 'raboof')
E       AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'

/home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0/cssutils/tests/test_domimplementation.py:31: AttributeError
______________________________ TestDOMImplementation.test_hasFeature ______________________________

self = <cssutils.tests.test_domimplementation.TestDOMImplementation object at 0x777e84ba9e90>

    def test_hasFeature(self):
        "DOMImplementationCSS.hasFeature()"
        tests = [
            ('css', '1.0'),
            ('css', '2.0'),
            ('stylesheets', '1.0'),
            ('stylesheets', '2.0'),
        ]
        for name, version in tests:
>           assert self.domimpl.hasFeature(name, version)
E           AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'

/home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0/cssutils/tests/test_domimplementation.py:43: AttributeError
_________________________________ TestPropertyValue.test_cssText __________________________________

self = <cssutils.tests.test_value.TestPropertyValue object at 0x777e84522b90>

    def test_cssText(self):
        "PropertyValue.cssText"
        tests = {
            '0': (None, 1, None),
            '0 0': (None, 2, None),
            '0, 0': (None, 2, None),
            '0,0': ('0, 0', 2, None),
            '0  ,   0': ('0, 0', 2, None),
            '0/0': (None, 2, None),
            '/**/ 0 /**/': (None, 1, '0'),
            '0 /**/ 0 /**/ 0': (None, 3, '0 0 0'),
            '0, /**/ 0, /**/ 0': (None, 3, '0, 0, 0'),
            '0//**/ 0//**/ 0': (None, 3, '0/0/0'),
            '/**/ red': (None, 1, 'red'),
            '/**/red': ('/**/ red', 1, 'red'),
            'red /**/': (None, 1, 'red'),
            'red/**/': ('red /**/', 1, 'red'),
            'a()1,-1,+1,1%,-1%,1px,-1px,"a",a,url(a),#aabb44': (
                'a() 1, -1, +1, 1%, -1%, 1px, -1px, "a", a, url(a), #ab4',
                12,
                'a() 1, -1, +1, 1%, -1%, 1px, -1px, "a", a, url(a), #ab4',
            ),
            # calc values
            'calc(1)': (None, 1, 'calc(1)'),
            'calc( 1)': ('calc(1)', 1, 'calc(1)'),
            'calc(1 )': ('calc(1)', 1, 'calc(1)'),
            'calc(1px)': (None, 1, 'calc(1px)'),
            'calc(1p-x-)': (None, 1, 'calc(1p-x-)'),
            'calc(1%)': (None, 1, 'calc(1%)'),
            'calc(-1)': (None, 1, 'calc(-1)'),
            'calc(+1)': (None, 1, 'calc(+1)'),
            'calc(1  +   1px)': ('calc(1 + 1px)', 1, 'calc(1 + 1px)'),
            'calc(1 - 1px)': (None, 1, 'calc(1 - 1px)'),
            'calc(1*1px)': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
            'calc(1  /  1px)': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
            'calc( 1*1px)': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
            'calc( 1  /  1px)': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
            'calc(1*1px )': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
            'calc(1  /  1px )': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
            'calc( 1*1px )': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
            'calc( 1  /  1px )': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
            'calc(calc(1px + 5px) * 4)': (
                'calc(calc(1px + 5px) * 4)',
                1,
                'calc(calc(1px + 5px) * 4)',
            ),
            'calc( calc(1px + 5px)*4 )': (
                'calc(calc(1px + 5px) * 4)',
                1,
                'calc(calc(1px + 5px) * 4)',
            ),
            'calc(var(X))': (None, 1, None),
            'calc(2 * var(X))': (None, 1, None),
            'calc(2px + var(X))': (None, 1, None),
            # issue #24
            'rgb(0, 10, 255)': (None, 1, 'rgb(0, 10, 255)'),
            'hsl(10, 10%, 25%)': (None, 1, 'hsl(10, 10%, 25%)'),
            'rgba(0, 10, 255, 0.5)': (None, 1, 'rgba(0, 10, 255, 0.5)'),
            'hsla(10, 10%, 25%, 0.5)': (None, 1, 'hsla(10, 10%, 25%, 0.5)'),
            # issue #27
            'matrix(0.000092, 0.2500010, -0.250000, 0.000092, 0, 0)': (
                'matrix(0.000092, 0.250001, -0.25, 0.000092, 0, 0)',
                1,
                'matrix(0.000092, 0.250001, -0.25, 0.000092, 0, 0)',
            ),
        }
        for cssText, (c, len, v) in list(tests.items()):
            if c is None:
                c = cssText
            if v is None:
                v = c
    
            pv = cssutils.css.PropertyValue(cssText)
            assert c == pv.cssText
            assert len == pv.length
            assert v == pv.value
    
        tests = {
            '0 0px -0px +0px': ('0 0 0 0', 4),
            '1 2 3 4': (None, 4),
            '-1 -2 -3 -4': (None, 4),
            '-1 2': (None, 2),
            '-1px red "x"': (None, 3),
            'a, b c': (None, 3),
            '1px1 2% 3': ('1px1 2% 3', 3),
            'f(+1pX, -2, 5%) 1': ('f(+1px, -2, 5%) 1', 2),
            '0 f()0': ('0 f() 0', 3),
            'f()0': ('f() 0', 2),
            'f()1%': ('f() 1%', 2),
            'f()1px': ('f() 1px', 2),
            'f()"str"': ('f() "str"', 2),
            'f()ident': ('f() ident', 2),
            'f()#123': ('f() #123', 2),
            'f()url()': ('f() url()', 2),
            'f()f()': ('f() f()', 2),
            'url(x.gif)0 0': ('url(x.gif) 0 0', 3),
            'url(x.gif)no-repeat': ('url(x.gif) no-repeat', 2),
        }
        for cssText, (c, len) in list(tests.items()):
            if c is None:
                c = cssText
            pv = cssutils.css.PropertyValue(cssText)
            assert c == pv.cssText
            assert len == pv.length
    
        tests = {
            # hash and rgb/a
            '#112234': '#112234',
            '#112233': '#123',
            'rgb(1,2,3)': 'rgb(1, 2, 3)',
            'rgb(  1  ,  2  ,  3  )': 'rgb(1, 2, 3)',
            'rgba(1,2,3,4)': 'rgba(1, 2, 3, 4)',
            'rgba(  1  ,  2  ,  3  ,  4 )': 'rgba(1, 2, 3, 4)',
            'rgb(-1,+2,0)': 'rgb(-1, +2, 0)',
            'rgba(-1,+2,0, 0)': 'rgba(-1, +2, 0, 0)',
            # FUNCTION
            'f(1,2)': 'f(1, 2)',
            'f(  1  ,  2  )': 'f(1, 2)',
            'f(-1,+2)': 'f(-1, +2)',
            'f(  -1  ,  +2  )': 'f(-1, +2)',
            'fun(  -1  ,  +2  )': 'fun(-1, +2)',
            'local( x )': 'local(x)',
            'test(1px, #111, y, 1, 1%, "1", y(), var(x))': 'test(1px, #111, y, 1, 1%, "1", y(), var(x))',
            'test(-1px, #111, y, -1, -1%, "1", -y())': 'test(-1px, #111, y, -1, -1%, "1", -y())',
            'url(y)  format( "x" ,  "y" )': 'url(y) format("x", "y")',
            'f(1 2,3 4)': 'f(1 2, 3 4)',
            # IE expression
            r'Expression()': 'Expression()',
            r'expression(-1 < +2)': 'expression(-1<+2)',
            r'expression(document.width == "1")': 'expression(document.width=="1")',
            'alpha(opacity=80)': 'alpha(opacity=80)',
            'alpha( opacity = 80 , x=2  )': 'alpha(opacity=80, x=2)',
            'expression(eval(document.documentElement.scrollTop))': 'expression(eval(document.documentElement.scrollTop))',
            # TODO
            #            u'expression((function(ele){ele.style.behavior="none";})(this))':
            #                u'expression((function(ele){ele.style.behavior="none";})(this))',
            # unicode-range
            'u+f': 'u+f',
            'U+ABCdef': 'u+abcdef',
            # url
            'url(a)': 'url(a)',
            'uRl(a)': 'url(a)',
            'u\\rl(a)': 'url(a)',
            'url("a")': 'url(a)',
            'url(  "a"  )': 'url(a)',
            'url(";")': 'url(";")',
            'url(",")': 'url(",")',
            'url(")")': 'url(")")',
            '''url("'")''': '''url("'")''',
            '''url('"')''': '''url("\\"")''',
            # operator
            '1': '1',
            '1 2': '1 2',
            '1   2': '1 2',
            '1,2': '1, 2',
            '1,  2': '1, 2',
            '1  ,2': '1, 2',
            '1  ,  2': '1, 2',
            '1/2': '1/2',
            '1/  2': '1/2',
            '1  /2': '1/2',
            '1  /  2': '1/2',
            # comment
            '1/**/2': '1 /**/ 2',
            '1 /**/2': '1 /**/ 2',
            '1/**/ 2': '1 /**/ 2',
            '1 /**/ 2': '1 /**/ 2',
            '1  /*a*/  /*b*/  2': '1 /*a*/ /*b*/ 2',
            # , before
            '1,/**/2': '1, /**/ 2',
            '1 ,/**/2': '1, /**/ 2',
            '1, /**/2': '1, /**/ 2',
            '1 , /**/2': '1, /**/ 2',
            # , after
            '1/**/,2': '1 /**/, 2',
            '1/**/ ,2': '1 /**/, 2',
            '1/**/, 2': '1 /**/, 2',
            '1/**/ , 2': '1 /**/, 2',
            # all
            '1/*a*/  ,/*b*/  2': '1 /*a*/, /*b*/ 2',
            '1  /*a*/,  /*b*/2': '1 /*a*/, /*b*/ 2',
            '1  /*a*/  ,  /*b*/  2': '1 /*a*/, /*b*/ 2',
            # list
            'a b1,b2 b2,b3,b4': 'a b1, b2 b2, b3, b4',
            'a b1  ,   b2   b2  ,  b3  ,   b4': 'a b1, b2 b2, b3, b4',
            'u+1  ,   u+2-5': 'u+1, u+2-5',
            'local( x ),  url(y)  format( "x" ,  "y" )': 'local(x), url(y) format("x", "y")',
            # FUNCTION
            'attr( href )': 'attr(href)',
            # PrinceXML extende FUNC syntax with nested FUNC
            'target-counter(attr(href),page)': 'target-counter(attr(href), page)',
        }
>       self.do_equal_r(tests)

/home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0/cssutils/tests/test_value.py:230: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <cssutils.tests.test_value.TestPropertyValue object at 0x777e84522b90>
tests = {'#112233': '#123', '#112234': '#112234', '1': '1', '1   2': '1 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: 'TestPropertyValue' object has no attribute 'r'

/home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0/cssutils/tests/basetest.py:41: AttributeError
======================================== warnings summary =========================================
cssutils/tests/test_encutils.py::TestAutoEncoding::test_getEncodingInfo
cssutils/tests/test_encutils.py::TestAutoEncoding::test_getEncodingInfo
  /home/okarin/.cache/yay/python-cssutils/src/cssutils-2.9.0/encutils/__init__.py:652: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
    log.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===================================== short test summary info =====================================
FAILED cssutils/tests/test_domimplementation.py::TestDOMImplementation::test_createCSSStyleSheet - AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'
FAILED cssutils/tests/test_domimplementation.py::TestDOMImplementation::test_createDocument - AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'
FAILED cssutils/tests/test_domimplementation.py::TestDOMImplementation::test_createDocumentType - AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'
FAILED cssutils/tests/test_domimplementation.py::TestDOMImplementation::test_hasFeature - AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'
FAILED cssutils/tests/test_value.py::TestPropertyValue::test_cssText - AttributeError: 'TestPropertyValue' object has no attribute 'r'
================ 5 failed, 396 passed, 42 xfailed, 1 xpassed, 2 warnings in 4.46s =================
==> ERROR: A failure occurred in check().
    Aborting...
 -> error making: python-cssutils-exit status 4
 -> Failed to install the following packages. Manual intervention is required:
python-cssutils - exit status 4 #43 

License Confusion

Hello cssutils team,

I just want to make sure that this project is indeed licensed under the LGPL v3.0. As such, is there any reason to include the GPL license (via the /COPYING file) in the source code?

Thanks for your time!

Implement CSS Colors level 4

In #28, a user reported an issue parsing colors with the / symbol in them. Here's a minimum reproducer:

python -m cssutils.scripts.cssparse -s '.any{color:rgb(0 0 0 / 0.4)}'
ERROR   COLOR_VALUE: Missing token for production end FUNC ")": ('CHAR', '/', 1, 22)
ERROR   PropertyValue: No match: ('CHAR', ')', 1, 27)
ERROR   PropertyValue: Unknown syntax or no value: rgb(0 0 0 / 0.4)
ERROR   CSSStyleDeclaration: Syntax Error in Property: color:rgb(0 0 0 / 0.4)
b''

Calc with internal parentheses being deleted.

Pardon the unusually high specificity of this bug, but this has been a serious blocker for me, and has cost me most of a day.

Basically, from my research I've found that any line of CSS including parentheses inside a calc statement will be removed. To test, all I'm doing with my CSS currently is parsing and printing it (Using the current v2.2.0 version, ofc):

stylesheet = cssutils.parseString(css_contents)
print(stylesheet.cssText.decode("utf-8"))

In my findings, even lengthy calcs like this will be left alone: font-size: calc(15px * 100vw - 600px / 1320);, but the moment any brackets are introduced it will fail, like this line: font-size: calc((100vw - 600px) * 10);.

Functions like this are supposedly meant to be handled according to the documents linked in the README, look at Example 29 for particulars. Regarding that same example, I've also tried nested calcs in the same fashion, to no avail: font-size: calc(calc(100vw - 600px) * 10);.

Basically what I'm asking, is if there's any way for this bug to be fixed or worked around? Ideally, I'd love something I can do today, to either skip validating these lines or to find a way to get them to pass without changing the meaning.

No support for rem

If I use rem as a length unit, I get an "invalid value" error:

ERROR Property: Invalid value for "CSS Backgrounds and Borders Module Level 3" property: 0.75rem [1:1: border-radius]

On investigation, it seems that in https://github.com/jaraco/cssutils/blob/main/cssutils/profiles.py, rem is not supported as a unit:
'length': r'0|{num}(em|ex|px|in|cm|mm|pt|pc)',

Is this something that could be added? I'm not particularly familiar with this module as it's a subdependency so I don't know if it would take more than just adding it to the pattern.

cgi deprecation warning

In 2.10.2 (the latest version) I'm seeing a deprecation warning:

/opt/venv/lib/python3.12/site-packages/cssutils/_fetchgae.py:6: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi

It seems this is still being using in this _fetchgae.py file, which has something to do with Google AppEngine? Can we remove this reference or update it? I saw 9d69993 which removed other references to cgi but one still remains.

Unable to declare custom CSS variables

Normally, CSS can set custom variables via the :root element selector, as such:

:root {
  --main-bg-color: blue;
}

However, cssutils errors with the following error message when attempting to use this:
xml.dom.SyntaxErr: CSSStyleDeclaration: Unexpected token, ignoring upto '--main-bg-color: blue;'

For larger projects, custom variables are a necessecity, especially when not utilizing SCSS or SASS.

Validation test failures

Several variants of test_validateWithProfile are failing to meet expectations:

 cssutils main $ tox -- -k validateWithProfile --runxfail
.pkg: _optional_hooks> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_editable> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_editable> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
py: install_package> python -I -m pip install --force-reinstall --no-deps .tox/.tmp/package/78/cssutils-2.7.2.dev5+g2878ecbf-0.editable-py3-none-any.whl
py: commands[0]> pytest -k validateWithProfile --runxfail
/Users/jaraco/code/jaraco/cssutils/.tox/py/lib/python3.11/site-packages/_pytest/faulthandler.py:30: EncodingWarning: 'encoding' argument not specified
  config.stash[fault_handler_stderr_key] = open(stderr_fd_copy, "w")
============================================================= test session starts ==============================================================
platform darwin -- Python 3.11.3, pytest-7.3.1, pluggy-1.0.0
cachedir: .tox/py/.pytest_cache
rootdir: /Users/jaraco/code/jaraco/cssutils
configfile: pytest.ini
plugins: black-0.3.12, enabler-2.1.1, mypy-0.10.3, cov-4.1.0, ruff-0.1, jaraco.test-5.3.0, checkdocs-2.9.0
collected 616 items / 596 deselected / 20 selected                                                                                             

cssutils/tests/test_profiles.py ...FFFFFF..........                                                                                      [100%]

=================================================================== FAILURES ===================================================================
___________________________________________ TestProfiles.test_validateWithProfile[params3-results3] ____________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x107b28e90>, params = ('color', 'rgba(0,0,0,0)', None)
results = (True, True, ['CSS Color Module Level 3'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (True, True, ...S Level 2.1']) == (True, True, ...ule Level 3'])
E         At index 2 diff: ['CSS Level 2.1'] != ['CSS Color Module Level 3']
E         Use -v to get more diff

cssutils/tests/test_profiles.py:232: AssertionError
___________________________________________ TestProfiles.test_validateWithProfile[params4-results4] ____________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x107b29150>, params = ('color', 'rgba(0,0,0,0)', 'CSS Level 2.1')
results = (True, False, ['CSS Color Module Level 3'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (True, True, ...S Level 2.1']) == (True, False,...ule Level 3'])
E         At index 1 diff: True != False
E         Use -v to get more diff

cssutils/tests/test_profiles.py:232: AssertionError
___________________________________________ TestProfiles.test_validateWithProfile[params5-results5] ____________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x107b29410>, params = ('color', 'rgba(0,0,0,0)', 'CSS Color Module Level 3')
results = (True, True, ['CSS Color Module Level 3'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (True, False,...S Level 2.1']) == (True, True, ...ule Level 3'])
E         At index 1 diff: False != True
E         Use -v to get more diff

cssutils/tests/test_profiles.py:232: AssertionError
___________________________________________ TestProfiles.test_validateWithProfile[params6-results6] ____________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x107b296d0>, params = ('color', '1px', None)
results = (False, False, ['CSS Color Module Level 3', 'CSS Level 2.1'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
E         At index 2 diff: ['CSS Level 2.1'] != ['CSS Color Module Level 3', 'CSS Level 2.1']
E         Use -v to get more diff

cssutils/tests/test_profiles.py:232: AssertionError
___________________________________________ TestProfiles.test_validateWithProfile[params7-results7] ____________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x107b29990>, params = ('color', '1px', 'CSS Level 2.1')
results = (False, False, ['CSS Color Module Level 3', 'CSS Level 2.1'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
E         At index 2 diff: ['CSS Level 2.1'] != ['CSS Color Module Level 3', 'CSS Level 2.1']
E         Use -v to get more diff

cssutils/tests/test_profiles.py:232: AssertionError
___________________________________________ TestProfiles.test_validateWithProfile[params8-results8] ____________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x107b29c50>, params = ('color', '1px', 'CSS Color Module Level 3')
results = (False, False, ['CSS Color Module Level 3', 'CSS Level 2.1'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
E         At index 2 diff: ['CSS Level 2.1'] != ['CSS Color Module Level 3', 'CSS Level 2.1']
E         Use -v to get more diff

cssutils/tests/test_profiles.py:232: AssertionError

---------- coverage: platform darwin, python 3.11.3-final-0 ----------
Name                                             Stmts   Miss  Cover   Missing
------------------------------------------------------------------------------
conftest.py                                         23      2    91%   32-33
cssutils/__init__.py                               139     81    42%   132-140, 147-149, 156-158, 161, 184, 191-194, 208-216, 220, 245-254, 271-272, 281, 284-291, 295-297, 320-333, 342-344, 348, 351-352, 356-401, 406-417, 421
cssutils/_fetch.py                                  33     15    55%   9-10, 32, 36-54
cssutils/_fetchgae.py                               21     19    10%   6-67
cssutils/codec.py                                  384    337    12%   25, 45-164, 178-187, 200-216, 220-237, 241-251, 256-259, 264-268, 273-281, 284-290, 298-329, 332-335, 338, 342-344, 349-359, 362-370, 375-381, 384-390, 393-420, 423-425, 428, 432-434, 439-443, 446-453, 458-462, 465-495, 498, 502-509, 516-520, 523-545, 548, 552-559, 566-568, 584-586
cssutils/css2productions.py                          7      0   100%
cssutils/css/__init__.py                            21      0   100%
cssutils/css/colors.py                               1      0   100%
cssutils/css/csscharsetrule.py                      55     39    29%   49-57, 60, 65, 73, 92-122, 142-163
cssutils/css/csscomment.py                          28      4    86%   34, 39, 47, 76
cssutils/css/cssfontfacerule.py                     71     53    25%   43-51, 54, 60, 69, 86-152, 165-170, 185-193
cssutils/css/cssimportrule.py                      185     70    62%   61, 73-77, 85-89, 125, 142-144, 153-159, 163-172, 176-212, 220-222, 247-248, 253-254, 267, 319-329, 342, 360, 373-374, 408, 432
cssutils/css/cssmediarule.py                       123    102    17%   36-46, 49, 55, 63, 86-256, 267, 271-278, 281, 288-295, 318-339
cssutils/css/cssnamespacerule.py                   119    101    15%   70-89, 92, 99, 110, 128-228, 244-252, 268-274, 286-310
cssutils/css/csspagerule.py                        172    142    17%   72-92, 95, 102, 116, 120, 126-128, 134-139, 145-147, 157-245, 249-278, 282, 299-357, 367, 387-393, 407-412, 423-445
cssutils/css/cssproperties.py                       35      6    83%   78, 81, 84, 133, 136, 139
cssutils/css/cssrule.py                            115     51    56%   80, 123, 136, 165-167, 171, 175-183, 210-229, 237-272, 276-279, 283, 321
cssutils/css/cssrulelist.py                         19      6    68%   26, 41-44, 49
cssutils/css/cssstyledeclaration.py                198     75    62%   121-125, 130-134, 139, 146, 154-158, 167, 197, 204, 210, 241, 262, 277, 283-284, 316, 325-333, 337-345, 381, 384, 421, 490-502, 523, 540-544, 575-592, 639-640, 643, 657-669, 696-697, 716, 735
cssutils/css/cssstylerule.py                        98     31    68%   44, 47, 54-58, 65, 108-109, 116, 121, 125, 136-137, 143-144, 152-153, 163-164, 171, 188-191, 235-239, 254, 274
cssutils/css/cssstylesheet.py                      370    221    40%   76-80, 88-92, 117, 128-130, 146, 180-182, 186-200, 208-213, 221-244, 248-262, 266-270, 274-278, 282-286, 290-307, 358-361, 401, 405, 411-413, 416-420, 429-432, 440-450, 472, 478-479, 493, 516-549, 590-591, 599-630, 638-640, 643-644, 649-666, 670-681, 687-701, 709-713, 716-730, 736-791, 795-843, 849-850, 853-859, 878-882, 889-892, 902
cssutils/css/cssunknownrule.py                     106     93    12%   26-31, 34, 39, 47, 64-215
cssutils/css/cssvalue.py                           437    308    30%   49-62, 65, 68, 117-409, 558, 561, 605-625, 629-636, 656-662, 665-667, 676, 684-687, 691-707, 728-749, 773-803, 815-823, 851-881, 891-894, 902-904, 914-917, 921, 925, 948-949, 953-954, 957, 970, 978-981, 1004-1010, 1014-1060, 1063-1097, 1120-1132, 1135, 1138, 1146-1194, 1208-1236, 1239, 1242, 1257-1287, 1290, 1294, 1312-1313, 1316, 1319, 1327-1345, 1360-1368
cssutils/css/cssvariablesdeclaration.py            105     72    31%   46, 51, 56, 68, 74, 77, 80, 93, 126-199, 209, 230-233, 250-264, 282-315, 332-335
cssutils/css/cssvariablesrule.py                    63     45    29%   55-66, 69, 76, 90, 118-183, 201-208
cssutils/css/marginrule.py                          54     33    39%   82-94, 98-110, 123, 130, 139, 156-205, 218-223
cssutils/css/property.py                           197     50    75%   90, 104-106, 132-135, 140-141, 146-147, 157-158, 175, 200-202, 222-223, 246, 268, 284, 287, 294, 325-329, 344-346, 356-358, 371-372, 381, 465-466, 470, 488, 499-510, 521, 532, 536
cssutils/css/selector.py                           352    209    41%   125-129, 132, 163-164, 171-172, 187, 226-227, 230, 245, 249, 257-261, 269, 276-280, 289, 297, 306, 314, 348, 352-354, 358, 361, 372, 377-393, 401, 403, 440-441, 447-450, 457, 461-474, 479-494, 506-532, 536-544, 550-559, 563-581, 591-592, 596-597, 602-603, 608-609, 617-619, 623-636, 640-653, 657-740, 744-752, 756-758, 796-797, 803-804, 809-810, 857
cssutils/css/selectorlist.py                       101     52    49%   41, 46-50, 53, 65-67, 71-78, 84-90, 109, 131-152, 156, 180-181, 193, 201-202, 211-212, 216-217
cssutils/css/value.py                              336    120    64%   54-56, 64-67, 71, 74, 77, 92, 180-181, 187, 209, 257, 260, 305, 332, 408-418, 421-478, 504-506, 522, 527, 532, 547, 576, 582, 612, 643, 655-661, 675-703, 706-712, 736-774, 777, 796, 801-856, 879, 887-924, 943, 949-964
cssutils/cssproductions.py                          15      0   100%
cssutils/errorhandler.py                            56     10    82%   47, 84, 91, 95-102, 108
cssutils/helper.py                                  47      7    85%   26-33, 91, 103, 116, 130
cssutils/parse.py                                   57     22    61%   51, 53, 58, 92-100, 134, 175-183, 207-215
cssutils/prodparser.py                             377     82    78%   111-115, 121, 155-157, 170-171, 183-187, 230, 235, 238, 241, 249, 324-327, 340, 361, 394, 398-404, 426, 429, 434-439, 442, 491-492, 526, 535, 543-545, 549, 574-598, 618, 630-634, 661-667, 674, 677-681, 689-690, 707, 898-905
cssutils/profiles.py                               180     50    72%   191, 195-198, 222-244, 287-292, 328-350, 359-367, 386-390, 432-433, 442-443
cssutils/sac.py                                    235    200    15%   31, 34, 37, 40, 63-66, 70, 75, 79, 84, 89, 94, 98, 103, 107, 114-115, 120-122, 127-128, 138-139, 145-148, 151, 154-155, 190-199, 202-432, 436, 440
cssutils/script.py                                 178    147    17%   33, 36-48, 51-52, 56, 60, 85-99, 107-125, 142-158, 171-203, 212-221, 233-256, 275-314, 347-374
cssutils/scripts/__init__.py                         2      0   100%
cssutils/scripts/csscapture.py                      32     25    22%   18-85, 95
cssutils/scripts/csscombine.py                      19     13    32%   61-115, 119
cssutils/scripts/cssparse.py                        34     28    18%   17-72, 76
cssutils/serialize.py                              594    288    52%   17-18, 114-115, 126, 227-230, 232, 234, 238, 245, 247, 251, 263, 266, 271, 273-274, 277, 279, 281, 283-284, 286, 332, 372-380, 397, 417-420, 430-433, 446-458, 469-481, 510, 515-519, 523, 536-548, 559-604, 620-653, 657-663, 677-706, 714-745, 762-777, 783, 791-792, 817, 821, 848-860, 864, 868-895, 934-935, 943-950, 958, 976, 980, 997, 1014-1022, 1027, 1033, 1038-1041, 1046-1049, 1054, 1060-1071, 1075-1083, 1087, 1107-1108, 1113, 1119, 1125-1142, 1147-1158, 1162-1180, 1190, 1199, 1212, 1220-1221
cssutils/settings.py                                 6      5    17%   12-17
cssutils/stylesheets/__init__.py                     5      0   100%
cssutils/stylesheets/medialist.py                  109     53    51%   46, 56, 62, 69-71, 120-121, 127-129, 147-154, 166-172, 180-182, 203-234, 238, 251-259, 268-271
cssutils/stylesheets/mediaquery.py                  52     10    81%   69, 75, 175-176, 208, 218-224
cssutils/stylesheets/stylesheet.py                  19      0   100%
cssutils/stylesheets/stylesheetlist.py               8      4    50%   24-27
cssutils/tests/__init__.py                           0      0   100%
cssutils/tests/basetest.py                          37     23    38%   9, 16, 22-28, 33-36, 40-44, 48-50, 54-56
cssutils/tests/test_codec.py                       212    196     8%   19, 23-28, 31-38, 44-118, 123-126, 130-143, 148-250, 256-311, 316-365
cssutils/tests/test_csscharsetrule.py               59     46    22%   11-14, 18-23, 27, 31-46, 50-61, 69-95, 99-100, 104-112
cssutils/tests/test_csscomment.py                   24     16    33%   10-13, 17-47, 53, 57-63
cssutils/tests/test_cssfontfacerule.py             130    116    11%   13-16, 20-58, 62-96, 100-164, 168-192, 196-201, 205-209, 213-231, 235-242
cssutils/tests/test_cssimportrule.py               226    208     8%   14-17, 21-81, 85-172, 177-202, 207-227, 231-245, 249-293, 297-324, 329-391, 395-409, 413, 417-430
cssutils/tests/test_cssmediarule.py                212    192     9%   13-19, 23-43, 47-57, 61-82, 86-111, 115-246, 253-263, 267-294, 299-333, 337-357, 362-368, 373-416, 420, 424-430, 434-442
cssutils/tests/test_cssnamespacerule.py            107     94    12%   11-15, 19-52, 57-125, 130-144, 148-173, 177, 181-200, 204-215
cssutils/tests/test_csspagerule.py                 193    176     9%   11-14, 18-57, 61-65, 69-73, 77-141, 145-174, 178-206, 210-229, 233-311, 315-378, 382-409, 413-421
cssutils/tests/test_cssproperties.py                28     21    25%   11-17, 21-27, 31-44
cssutils/tests/test_cssrule.py                     128    116     9%   28-29, 32-36, 40-44, 48-131, 135-192, 196-202, 216-251
cssutils/tests/test_cssrulelist.py                  17     12    29%   10-17, 21-35
cssutils/tests/test_cssstyledeclaration.py         313    283    10%   11, 15-31, 35-60, 64-70, 74-94, 98-101, 106-154, 158-170, 174-200, 205-263, 267-270, 274-298, 302-311, 315-343, 347-351, 373-397, 401-413, 417-436, 440-486, 490-500, 504-520, 524-540, 544-572, 576-581, 585-594
cssutils/tests/test_cssstylerule.py                130    115    12%   11-14, 18-23, 27-109, 113-163, 167-179, 183-191, 195-200, 204-223, 231-239, 243-248
cssutils/tests/test_cssstylesheet.py               486    450     7%   11-13, 17-35, 39-48, 52-105, 109-120, 124-230, 234-255, 262-271, 275-294, 299-351, 357-426, 444-476, 481-505, 510-515, 519-548, 552-578, 582-607, 611-672, 675-720, 724-745, 753-780, 784-797, 801-805, 809-813, 817-821, 825-829, 833-847, 851-856, 860-871, 875-886, 889-897
cssutils/tests/test_cssunknownrule.py               55     46    16%   10-13, 17-54, 58-126, 130, 134-137
cssutils/tests/test_cssutils.py                    216    195    10%   17, 29-72, 77-190, 194-231, 245-258, 262-276, 283-315, 319-350, 359-477
cssutils/tests/test_cssutilsimport.py                8      5    38%   9-18
cssutils/tests/test_cssvalue.py                    306    276    10%   16, 20-23, 27-41, 45-94, 100-266, 270-274, 278-334, 338-346, 350-358, 364-383, 387-389, 393-417, 421-454, 461-501, 505-652, 656-679, 684-816, 820-837, 841-850, 856-864, 868-896, 900-906
cssutils/tests/test_cssvariablesdeclaration.py     101     87    14%   11, 15-26, 30-35, 39-70, 74-75, 80-125, 129-145, 150-311, 336-343, 347-352
cssutils/tests/test_cssvariablesrule.py             87     74    15%   11-16, 20-31, 35-39, 43-47, 51-64, 68-72, 76-133, 137-143
cssutils/tests/test_domimplementation.py            25     15    40%   12, 16-22, 26-27, 31-32, 36-43
cssutils/tests/test_encutils/__init__.py            57     41    28%   20-37, 41-56, 60-76, 80-95, 99-188, 192-208, 212-227, 232-466
cssutils/tests/test_errorhandler.py                 98     83    15%   19-20, 28-34, 38-71, 75-90, 94-124, 127-152
cssutils/tests/test_helper.py                       33     26    21%   9-20, 24-35, 39-45, 49-55, 59-61
cssutils/tests/test_marginrule.py                   40     29    28%   11-14, 19-34, 49-54, 57-68, 83-91
cssutils/tests/test_medialist.py                   103     85    17%   14, 18-34, 38-75, 79-95, 99, 107-115, 119-131, 135-141, 145-173, 177-180, 184-192
cssutils/tests/test_mediaquery.py                   33     23    30%   11, 15-49, 53-66, 71-90, 94-99
cssutils/tests/test_parse.py                       214    191    11%   17-20, 24-60, 64-69, 74-141, 147-228, 232-290, 307-408, 412-422, 426-437, 447-481, 485-500, 505-516, 520-532, 537-549, 553-562
cssutils/tests/test_prodparser.py                  232    205    12%   21-28, 32-35, 40-49, 53-76, 80-85, 91-96, 100-116, 120-127, 131-141, 145-163, 167-252, 258-290, 294-309, 313-334, 338-348, 353, 357-369, 373-422
cssutils/tests/test_profiles.py                    113     61    46%   33-38, 42-47, 52-78, 84-118, 122-127, 236, 243-264, 272-696
cssutils/tests/test_properties.py                   65     53    18%   13-67, 71, 75-93, 99-110, 114-209, 213-230, 240-246
cssutils/tests/test_property.py                    119    103    13%   15, 19-63, 67-108, 112-145, 149-154, 158-169, 173-206, 210-236, 240-254
cssutils/tests/test_scripts_csscombine.py           29     22    24%   15-36, 41-61
cssutils/tests/test_selector.py                     82     67    18%   20, 24-41, 45-70, 74-113, 122-132, 139-149, 153-377, 381-445, 449-457
cssutils/tests/test_selectorlist.py                 82     70    15%   12, 16-33, 38-56, 60-100, 104-136, 140-148
cssutils/tests/test_serialize.py                   297    264    11%   14-44, 48-117, 121-201, 205-210, 214-231, 235-239, 243-260, 264-274, 278-298, 302-314, 321-325, 330-387, 398-429, 433-470, 475-488, 492-499, 503-511, 515-519, 523-527, 531-539, 543-547, 551-555, 559-562, 565-577, 582-608, 617-657, 661-669, 677-685, 690-730
cssutils/tests/test_settings.py                      9      5    44%   10-18
cssutils/tests/test_stylesheet.py                   21     18    14%   9-38
cssutils/tests/test_tokenize2.py                    58     36    38%   502, 506-526, 530-556, 574, 585
cssutils/tests/test_util.py                        197    163    17%   18-44, 50-61, 67-144, 153-368, 381-500, 507, 510-524, 527-529, 532-534, 537-539, 542-543, 546-548, 551-554, 557-558, 561, 564-565, 568-569, 572-575, 578-581, 584-587, 590-591, 594
cssutils/tests/test_value.py                       394    348    12%   11, 15-34, 38-298, 303-315, 320-341, 345-349, 353-361, 365-373, 379-382, 387-414, 420-425, 429-486, 490-518, 524-538, 542-551, 555-588, 594-598, 603-645, 651-654, 658-673, 679-683, 687-711, 716-772, 779-798, 802-804, 808-832, 836-869, 876-916, 920-1066, 1070-1093, 1098-1230, 1234-1251
cssutils/tests/test_x.py                            28     22    21%   14-42
cssutils/tokenize2.py                              134     35    74%   39, 88, 113-117, 132-134, 138-141, 163-168, 187, 192, 197-202, 227-236, 288-290
cssutils/util.py                                   500    208    58%   36, 46-51, 70, 102-105, 108, 111, 114-118, 125, 129, 209, 227, 232, 236, 249, 258-265, 302-303, 306-307, 311-313, 323-325, 327-328, 337, 339, 341, 347-348, 355, 357, 360, 362, 377, 380-383, 400-410, 414-415, 419, 423, 470-475, 486-487, 514-529, 534-535, 542-543, 579, 587-596, 624, 633-636, 639, 650-653, 659, 665-669, 699, 730, 733, 736, 745, 749, 753, 779, 782, 789-799, 802-805, 808, 811, 815-827, 831-836, 849-850, 863, 869-872, 875, 894, 902, 909, 952-997, 1061-1066, 1073-1074, 1081-1086, 1095-1100, 1107-1108, 1115-1116
docs/conf.py                                        10      0   100%
encutils/__init__.py                               219    178    19%   69-72, 132, 144-147, 150, 184, 202-229, 236-239, 254-271, 284-294, 310-331, 356-428, 449-483, 567-684, 688-690
examples/__init__.py                                 0      0   100%
examples/build.py                                   25     18    28%   44-69, 73
examples/codec.py                                   11      5    55%   11-15
examples/cssencodings.py                            25     20    20%   44-77, 81
examples/customlog.py                               14      7    50%   16-23, 27
examples/imports.py                                 21     15    29%   27-42, 46
examples/minify.py                                  14     10    29%   6-25, 29
examples/parse.py                                   19     13    32%   9-29, 33
examples/properties_with_same_name.py               30      0   100%
examples/selectors_tolower.py                       18     13    28%   8-29, 33
examples/serialize.py                               37      0   100%
examples/styledeclaration.py                        31      0   100%
examples/testutil.py                                66     48    27%   23, 26-29, 32-33, 39-44, 48-60, 69-76, 82-109, 113
examples/website.py                                  8      0   100%
------------------------------------------------------------------------------
TOTAL                                            12579   8528    32%

=========================================================== short test summary info ============================================================
FAILED cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params3-results3] - AssertionError: assert (True, True, ...S Level 2.1']) == (True, True, ...ule Level 3'])
FAILED cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params4-results4] - AssertionError: assert (True, True, ...S Level 2.1']) == (True, False,...ule Level 3'])
FAILED cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params5-results5] - AssertionError: assert (True, False,...S Level 2.1']) == (True, True, ...ule Level 3'])
FAILED cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params6-results6] - AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
FAILED cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params7-results7] - AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
FAILED cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params8-results8] - AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
================================================= 6 failed, 13 passed, 596 deselected in 1.26s =================================================
py: exit 1 (1.57 seconds) /Users/jaraco/code/jaraco/cssutils> pytest -k validateWithProfile --runxfail pid=34681
.pkg: _exit> python /Users/jaraco/.local/pipx/venvs/tox/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  py: FAIL code 1 (2.55=setup[0.97]+cmd[1.57] seconds)
  evaluation failed :( (2.61 seconds)

Someone should investigate and ascertain if those tests are meaningful and if something should be corrected or if those tests should be removed.

Python 3.11 test regressions due to changed exception messages

(via tox -e py311, with Python 3.11.0b3)

============================================================== FAILURES ===============================================================
__________________________________________________ PropertyTestCase.test_literalname __________________________________________________

self = <cssutils.tests.test_property.PropertyTestCase testMethod=test_literalname>, excClass = <class 'AttributeError'>
msg = "can't set attribute", callableObj = <method-wrapper '__setattr__' of Property object at 0x7f9dfead21d0>
args = ('literalname', 'color'), kwargs = {}, excMsg = "property 'literalname' of 'Property' object has no setter"

    def assertRaisesMsg(self, excClass, msg, callableObj, *args, **kwargs):
        """
        Just like unittest.TestCase.assertRaises,
        but checks that the message is right too.
    
        Usage::
    
            self.assertRaisesMsg(
                MyException, "Exception message",
                my_function, (arg1, arg2)
                )
    
        from
        http://www.nedbatchelder.com/blog/200609.html#e20060905T064418
        """
        try:
>           callableObj(*args, **kwargs)
E           AttributeError: property 'literalname' of 'Property' object has no setter

/tmp/cssutils/cssutils/tests/basetest.py:105: AttributeError

During handling of the above exception, another exception occurred:

self = <cssutils.tests.test_property.PropertyTestCase testMethod=test_literalname>

    def test_literalname(self):
        "Property.literalname"
        p = cssutils.css.property.Property(r'c\olor', 'red')
        self.assertEqual(r'c\olor', p.literalname)
>       self.assertRaisesMsg(
            AttributeError, "can't set attribute", p.__setattr__, 'literalname', 'color'
        )

/tmp/cssutils/cssutils/tests/test_property.py:162: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <cssutils.tests.test_property.PropertyTestCase testMethod=test_literalname>, excClass = <class 'AttributeError'>
msg = "can't set attribute", callableObj = <method-wrapper '__setattr__' of Property object at 0x7f9dfead21d0>
args = ('literalname', 'color'), kwargs = {}, excMsg = "property 'literalname' of 'Property' object has no setter"

    def assertRaisesMsg(self, excClass, msg, callableObj, *args, **kwargs):
        """
        Just like unittest.TestCase.assertRaises,
        but checks that the message is right too.
    
        Usage::
    
            self.assertRaisesMsg(
                MyException, "Exception message",
                my_function, (arg1, arg2)
                )
    
        from
        http://www.nedbatchelder.com/blog/200609.html#e20060905T064418
        """
        try:
            callableObj(*args, **kwargs)
        except excClass as exc:
            excMsg = str(exc)
            if not msg:
                # No message provided: any message is fine.
                return
            elif msg in excMsg:
                # Message provided, and we got the right message: passes.
                return
            else:
                # Message provided, and it didn't match: fail!
>               raise self.failureException(
                    "Right exception, wrong message: got '%s' instead of '%s'"
                    % (excMsg, msg)
                )
E               AssertionError: Right exception, wrong message: got 'property 'literalname' of 'Property' object has no setter' instead of 'can't set attribute'

/tmp/cssutils/cssutils/tests/basetest.py:116: AssertionError
__________________________________________________ SelectorTestCase.test_specificity __________________________________________________

self = <cssutils.tests.test_selector.SelectorTestCase testMethod=test_specificity>, excClass = <class 'AttributeError'>
msg = "can't set attribute", callableObj = <function SelectorTestCase.test_specificity.<locals>._set at 0x7f9dfed3fce0>, args = ()
kwargs = {}, excMsg = "property 'specificity' of 'Selector' object has no setter"

    def assertRaisesMsg(self, excClass, msg, callableObj, *args, **kwargs):
        """
        Just like unittest.TestCase.assertRaises,
        but checks that the message is right too.
    
        Usage::
    
            self.assertRaisesMsg(
                MyException, "Exception message",
                my_function, (arg1, arg2)
                )
    
        from
        http://www.nedbatchelder.com/blog/200609.html#e20060905T064418
        """
        try:
>           callableObj(*args, **kwargs)

/tmp/cssutils/cssutils/tests/basetest.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def _set():
>       selector.specificity = 1
E       AttributeError: property 'specificity' of 'Selector' object has no setter

/tmp/cssutils/cssutils/tests/test_selector.py:386: AttributeError

During handling of the above exception, another exception occurred:

self = <cssutils.tests.test_selector.SelectorTestCase testMethod=test_specificity>

    def test_specificity(self):
        "Selector.specificity"
        selector = cssutils.css.Selector()
    
        # readonly
        def _set():
            selector.specificity = 1
    
>       self.assertRaisesMsg(AttributeError, "can't set attribute", _set)

/tmp/cssutils/cssutils/tests/test_selector.py:388: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <cssutils.tests.test_selector.SelectorTestCase testMethod=test_specificity>, excClass = <class 'AttributeError'>
msg = "can't set attribute", callableObj = <function SelectorTestCase.test_specificity.<locals>._set at 0x7f9dfed3fce0>, args = ()
kwargs = {}, excMsg = "property 'specificity' of 'Selector' object has no setter"

    def assertRaisesMsg(self, excClass, msg, callableObj, *args, **kwargs):
        """
        Just like unittest.TestCase.assertRaises,
        but checks that the message is right too.
    
        Usage::
    
            self.assertRaisesMsg(
                MyException, "Exception message",
                my_function, (arg1, arg2)
                )
    
        from
        http://www.nedbatchelder.com/blog/200609.html#e20060905T064418
        """
        try:
            callableObj(*args, **kwargs)
        except excClass as exc:
            excMsg = str(exc)
            if not msg:
                # No message provided: any message is fine.
                return
            elif msg in excMsg:
                # Message provided, and we got the right message: passes.
                return
            else:
                # Message provided, and it didn't match: fail!
>               raise self.failureException(
                    "Right exception, wrong message: got '%s' instead of '%s'"
                    % (excMsg, msg)
                )
E               AssertionError: Right exception, wrong message: got 'property 'specificity' of 'Selector' object has no setter' instead of 'can't set attribute'

/tmp/cssutils/cssutils/tests/basetest.py:116: AssertionError

Find duplicated selectors [script]

I was thinking to create a new tool using this package.
Basically a tool that reports how many selectors are duplicated with lines so manually I can check and aggregate them in case.
There are exceptions like for media query but let's start with a first step.

#!/usr/bin/env python
import cssutils
import sys

with open(sys.argv[1]) as f:
    style = f.readlines()

stylesheet = cssutils.parseFile(sys.argv[1])

selectors = {}

for rule in stylesheet.cssRules:
    if rule.type == cssutils.css.CSSRule.STYLE_RULE: # Check if it is a selector
        if rule.selectorText in selectors:
            selectors[rule.selectorText] += 1
        else:
            selectors[rule.selectorText] = 1

print(selectors)

With this css:

.text {
    color: red;
}

.text {
    background: grey;
}

.text, div {
    display:block;
}

Returns: {'.text': 2, '.text, div': 1}
Are missing the lines but right now is good enough, the issue is another one.

The idea is good but how I can get the single selector in a case of a multiple selectors for the same rule?

Also I don't know if this can be a good script example provided with this tool like for csscombine.

Wrong specificity

Hello,

I got wrong specificity on this selector .form-floating > .form-control:focus ~ label::after, with https://specificity.keegan.st/ I see 032 whereas with your tool 022

Script to reproduce :

from cssutils import CSSParser


parser = CSSParser(parseComments=False, validate=None)
allrules = parser.parseString(
    ".form-floating > .form-control:focus ~ label::after{color:red}"
)
for el in allrules:
    print(el.selectorList[0].specificity)  # (0, 0, 2, 2)

Thanks

python-3.10 tests run failure

In Fedora 35, we got python-3.10 update. It is observed that cssutils-2.3.0 is failing on 3 test runs against python-3.10.

=========================== short test summary info ============================
FAILED cssutils/tests/test_property.py::PropertyTestCase::test_literalname - ...
FAILED cssutils/tests/test_selector.py::SelectorTestCase::test_specificity - ...
FAILED examples/website.py::website.logging

Here is the complete failure log.

=================================== FAILURES ===================================
______________________ PropertyTestCase.test_literalname _______________________
self = <cssutils.tests.test_property.PropertyTestCase testMethod=test_literalname>
excClass = <class 'AttributeError'>, msg = "can't set attribute"
callableObj = <method-wrapper '__setattr__' of Property object at 0xb4afdf28>
args = ('literalname', 'color'), kwargs = {}
excMsg = "can't set attribute 'literalname'"
    def assertRaisesMsg(self, excClass, msg, callableObj, *args, **kwargs):
        """
        Just like unittest.TestCase.assertRaises,
        but checks that the message is right too.
    
        Usage::
    
            self.assertRaisesMsg(
                MyException, "Exception message",
                my_function, (arg1, arg2)
                )
    
        from
        http://www.nedbatchelder.com/blog/200609.html#e20060905T064418
        """
        try:
>           callableObj(*args, **kwargs)
E           AttributeError: can't set attribute 'literalname'
/builddir/build/BUILD/cssutils-2.3.0/cssutils/tests/basetest.py:123: AttributeError
During handling of the above exception, another exception occurred:
self = <cssutils.tests.test_property.PropertyTestCase testMethod=test_literalname>
    def test_literalname(self):
        "Property.literalname"
        p = cssutils.css.property.Property(r'c\olor', 'red')
        self.assertEqual(r'c\olor', p.literalname)
>       self.assertRaisesMsg(
            AttributeError, "can't set attribute", p.__setattr__, 'literalname', 'color'
        )
/builddir/build/BUILD/cssutils-2.3.0/cssutils/tests/test_property.py:162: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <cssutils.tests.test_property.PropertyTestCase testMethod=test_literalname>
excClass = <class 'AttributeError'>, msg = "can't set attribute"
callableObj = <method-wrapper '__setattr__' of Property object at 0xb4afdf28>
args = ('literalname', 'color'), kwargs = {}
excMsg = "can't set attribute 'literalname'"
    def assertRaisesMsg(self, excClass, msg, callableObj, *args, **kwargs):
        """
        Just like unittest.TestCase.assertRaises,
        but checks that the message is right too.
    
        Usage::
    
            self.assertRaisesMsg(
                MyException, "Exception message",
                my_function, (arg1, arg2)
                )
    
        from
        http://www.nedbatchelder.com/blog/200609.html#e20060905T064418
        """
        try:
            callableObj(*args, **kwargs)
        except excClass as exc:
            excMsg = str(exc)
            if not msg:
                # No message provided: any message is fine.
                return
            elif excMsg == msg:
                # Message provided, and we got the right message: passes.
                return
            else:
                # Message provided, and it didn't match: fail!
>               raise self.failureException(
                    "Right exception, wrong message: got '%s' instead of '%s'"
                    % (excMsg, msg)
                )
E               AssertionError: Right exception, wrong message: got 'can't set attribute 'literalname'' instead of 'can't set attribute'
/builddir/build/BUILD/cssutils-2.3.0/cssutils/tests/basetest.py:134: AssertionError
______________________ SelectorTestCase.test_specificity _______________________
self = <cssutils.tests.test_selector.SelectorTestCase testMethod=test_specificity>
excClass = <class 'AttributeError'>, msg = "can't set attribute"
callableObj = <function SelectorTestCase.test_specificity.<locals>._set at 0xb4ac39b8>
args = (), kwargs = {}, excMsg = "can't set attribute 'specificity'"
    def assertRaisesMsg(self, excClass, msg, callableObj, *args, **kwargs):
        """
        Just like unittest.TestCase.assertRaises,
        but checks that the message is right too.
    
        Usage::
    
            self.assertRaisesMsg(
                MyException, "Exception message",
                my_function, (arg1, arg2)
                )
    
        from
        http://www.nedbatchelder.com/blog/200609.html#e20060905T064418
        """
        try:
>           callableObj(*args, **kwargs)
/builddir/build/BUILD/cssutils-2.3.0/cssutils/tests/basetest.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    def _set():
>       selector.specificity = 1
E       AttributeError: can't set attribute 'specificity'
/builddir/build/BUILD/cssutils-2.3.0/cssutils/tests/test_selector.py:386: AttributeError
During handling of the above exception, another exception occurred:
self = <cssutils.tests.test_selector.SelectorTestCase testMethod=test_specificity>
    def test_specificity(self):
        "Selector.specificity"
        selector = cssutils.css.Selector()
    
        # readonly
        def _set():
            selector.specificity = 1
    
>       self.assertRaisesMsg(AttributeError, "can't set attribute", _set)
/builddir/build/BUILD/cssutils-2.3.0/cssutils/tests/test_selector.py:388: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <cssutils.tests.test_selector.SelectorTestCase testMethod=test_specificity>
excClass = <class 'AttributeError'>, msg = "can't set attribute"
callableObj = <function SelectorTestCase.test_specificity.<locals>._set at 0xb4ac39b8>
args = (), kwargs = {}, excMsg = "can't set attribute 'specificity'"
    def assertRaisesMsg(self, excClass, msg, callableObj, *args, **kwargs):
        """
        Just like unittest.TestCase.assertRaises,
        but checks that the message is right too.
    
        Usage::
    
            self.assertRaisesMsg(
                MyException, "Exception message",
                my_function, (arg1, arg2)
                )
    
        from
        http://www.nedbatchelder.com/blog/200609.html#e20060905T064418
        """
        try:
            callableObj(*args, **kwargs)
        except excClass as exc:
            excMsg = str(exc)
            if not msg:
                # No message provided: any message is fine.
                return
            elif excMsg == msg:
                # Message provided, and we got the right message: passes.
                return
            else:
                # Message provided, and it didn't match: fail!
>               raise self.failureException(
                    "Right exception, wrong message: got '%s' instead of '%s'"
                    % (excMsg, msg)
                )
E               AssertionError: Right exception, wrong message: got 'can't set attribute 'specificity'' instead of 'can't set attribute'
/builddir/build/BUILD/cssutils-2.3.0/cssutils/tests/basetest.py:134: AssertionError
__________________________ [doctest] website.logging ___________________________
050     >>> import cssutils, logging
051     >>> cssutils.log.setLevel(logging.FATAL)
052     >>> import logging, io, cssutils
053     >>> mylog = io.StringIO()
054     >>> h = logging.StreamHandler(mylog)
055     >>> h.setFormatter(logging.Formatter('%(levelname)s %(message)s'))
056     >>> cssutils.log.addHandler(h)
057     >>> cssutils.log.setLevel(logging.INFO)
058     >>> sheet = cssutils.parseString('a { x: 1; } @import "http://cthedot.de/not-present.css";')
059     >>> print(mylog.getvalue())
Differences (unified diff with -expected +actual):
    @@ -1,5 +1,5 @@
     WARNING Property: Unknown Property name. [1:5: x]
    -WARNING HTTPError opening url=http://cthedot.de/not-present.css: 404 Not Found
    -WARNING CSSImportRule: While processing imported style sheet href=http://cthedot.de/not-present.css: OSError('Cannot read Stylesheet.'...)
    +WARNING URLError, [Errno -3] Temporary failure in name resolution
    +WARNING CSSImportRule: While processing imported style sheet href=http://cthedot.de/not-present.css: OSError('Cannot read Stylesheet.')
     ERROR CSSStylesheet: CSSImportRule not allowed here. [1:13: @import]
     <BLANKLINE>
/builddir/build/BUILD/cssutils-2.3.0/examples/website.py:59: DocTestFailure
----------------------------- Captured stderr call -----------------------------
WARNING	Property: Unknown Property name. [1:5: x]
WARNING	URLError, [Errno -3] Temporary failure in name resolution
WARNING	CSSImportRule: While processing imported style sheet href=http://cthedot.de/not-present.css: OSError('Cannot read Stylesheet.')
ERROR	CSSStylesheet: CSSImportRule not allowed here. [1:13: @import]
------------------------------ Captured log call -------------------------------
WARNING  CSSUTILS:errorhandler.py:104 Property: Unknown Property name. [1:5: x]
WARNING  CSSUTILS:errorhandler.py:104 URLError, [Errno -3] Temporary failure in name resolution
WARNING  CSSUTILS:errorhandler.py:104 CSSImportRule: While processing imported style sheet href=http://cthedot.de/not-present.css: OSError('Cannot read Stylesheet.')
ERROR    CSSUTILS:errorhandler.py:104 CSSStylesheet: CSSImportRule not allowed here. [1:13: @import]
=========================== short test summary info ============================
FAILED cssutils/tests/test_property.py::PropertyTestCase::test_literalname - ...
FAILED cssutils/tests/test_selector.py::SelectorTestCase::test_specificity - ...
FAILED examples/website.py::website.logging
======================== 3 failed, 394 passed in 9.27s =========================

testParsefile changes the CWD

Recently, the tests for the project's docs (using pytest-checkdocs) started failing when "." doesn't point to a directory with a pyproject.toml. When this happens, the attempt to load metadata from the project fails with:

ERROR Source . does not appear to be a Python project: no pyproject.toml or setup.py

And at the time the failure occurs, the cwd is <project_root>/cssutils/tests, presumably because testParsefile changes the directory:

# name is used for open and setting of href automatically
# test needs to be relative to this test file!
os.chdir(os.path.dirname(__file__))
name = basetest.get_sheet_filename('import.css')

Why did this issue not occur before? I'm unsure, but I suspect it has something to do with the order in which the tests were run. I can no longer see the tests for the last time they passed.

Regardless, that test should be hermetic; let's make it so.

2.4.0: sphinx warnings

Looks like lates sphix shows some warnings on generate documentation

running build_sphinx
Running Sphinx v4.5.0
making output directory... done
Temporary build environment: /tmp/pep517-build-env-6x29zbw8
Calling pip to install ['setuptools>=56', 'setuptools_scm[toml]>=3.4.1']
Collecting setuptools>=56
  Using cached setuptools-62.0.0-py3-none-any.whl (1.1 MB)
Collecting setuptools_scm[toml]>=3.4.1
  Using cached setuptools_scm-6.4.2-py3-none-any.whl (37 kB)
Collecting tomli>=1.0.0
  Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting packaging>=20.0
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting pyparsing!=3.0.5,>=2.0.2
  Using cached pyparsing-3.0.7-py3-none-any.whl (98 kB)
Installing collected packages: tomli, setuptools, pyparsing, packaging, setuptools_scm
Successfully installed packaging pyparsing setuptools setuptools_scm tomli
Got build requires: ['wheel']
Calling pip to install ['wheel']
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.1
Installed dynamic build dependencies
Trying to build metadata in /tmp/tmpfuibm8h5
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 17 added, 0 changed, 0 removed
reading sources... [100%] variables
WARNING: autodoc: failed to import class 'CSSCalc' from module 'cssutils.css'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/util/inspect.py", line 440, in safe_getattr
    return getattr(obj, name, *defargs)
AttributeError: module 'cssutils.css' has no attribute 'CSSCalc'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 102, in import_object
    obj = attrgetter(obj, mangled_name)
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 327, in get_attr
    return autodoc_attrgetter(self.env.app, obj, name, *defargs)
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 2827, in autodoc_attrgetter
    return safe_getattr(obj, name, *defargs)
  File "/usr/lib/python3.8/site-packages/sphinx/util/inspect.py", line 456, in safe_getattr
    raise AttributeError(name) from exc
AttributeError: CSSCalc

/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/docs/variables.rst:4: WARNING: duplicate object description of cssutils.css, other instance in css, use :noindex: for one of them
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-cssutils.3 { history migrate known issues parse utilities settings serialize css stylesheets profiles variables logging scripts codec encutils backlog } CHANGES (links).rst:492: WARNING: py:meth reference target not found: cssutils.css.Property.validate(profiles=None)
CHANGES (links).rst:517: WARNING: py:attr reference target not found: cssutils.profiles.Profiles.Profiles.CSS_LEVEL_2
CHANGES (links).rst:519: WARNING: py:attr reference target not found: cssutils.profiles.Profiles.Profiles.CSS_COLOR_LEVEL_3
CHANGES (links).rst:522: WARNING: py:attr reference target not found: cssutils.profiles.Profiles.Profiles.CSS_BOX_LEVEL_3
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/__init__.py:docstring of cssutils.getUrls:1: WARNING: py:class reference target not found: cssutils.css.CSSValue
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/__init__.py:docstring of cssutils.replaceUrls:1: WARNING: py:class reference target not found: cssutils.css.CSSValue
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/docs/serialize.rst:60: WARNING: py:attr reference target not found: cssutils.ser
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/docs/serialize.rst:62: WARNING: py:attr reference target not found: cssutils.ser.prefs
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/docs/css.rst:11: WARNING: py:attr reference target not found: cssutils.css.CSSStyleSheet.cssRules
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/css/cssrule.py:docstring of cssutils.css.cssrule.CSSRule:1: WARNING: py:class reference target not found: CSSUnknownRule
docstring of cssutils.css.CSSRule.UNKNOWN_RULE:1: WARNING: py:class reference target not found: cssutils.css.CSSUnknownRule
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/css/cssstyledeclaration.py:docstring of cssutils.css.cssstyledeclaration.CSSStyleDeclaration.getPropertyCSSValue:10: WARNING: py:class reference target not found: cssutils.css.CSSValue
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/docs/css.rst:267: WARNING: py:class reference target not found: cssutils.css.CSSValueList
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/docs/css.rst:267: WARNING: py:class reference target not found: cssutils.css.CSSValue
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/stylesheets/mediaquery.py:docstring of cssutils.stylesheets.mediaquery.MediaQuery:1: WARNING: py:const reference target not found: MediaQuery.MEDIA_TYPES
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/stylesheets/mediaquery.py:docstring of cssutils.stylesheets.MediaQuery.mediaType:1: WARNING: py:attr reference target not found: MEDIA_TYPES
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles:8: WARNING: py:attr reference target not found: cssutils.profiles.Profiles.CSS_LEVEL_2
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles:10: WARNING: py:attr reference target not found: cssutils.profiles.Profiles.CSS3_BASIC_USER_INTERFACE
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles:12: WARNING: py:attr reference target not found: cssutils.profiles.Profiles.CSS3_BOX
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles:14: WARNING: py:attr reference target not found: cssutils.profiles.Profiles.CSS3_COLOR
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles:17: WARNING: py:attr reference target not found: cssutils.profiles.Profiles.CSS3_PAGED_MEDIA
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles:21: WARNING: py:attr reference target not found: cssutils.profiles.Profiles._TOKEN_MACROS
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles:24: WARNING: py:attr reference target not found: cssutils.profiles.Profiles._MACROS
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles.addProfile:20: WARNING: py:attr reference target not found: Profiles._TOKEN_MACROS
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles.addProfile:20: WARNING: py:attr reference target not found: Profiles._MACROS
/home/tkloczko/rpmbuild/BUILD/cssutils-2.4.0/cssutils/profiles.py:docstring of cssutils.profiles.Profiles.removeProfile:12: WARNING: py:exc reference target not found: cssutils.profiles.NoSuchProfileException
done
build succeeded, 28 warnings.

Implement CSS Text Module Level 3

for example:

python -m cssutils.scripts.cssparse -s 'a {word-break: normal;}'
WARNING	Property: Unknown Property name. [1:4: word-break]
b'a {\n    word-break: normal\n    }'

Can I help? Where to start?

getUrls method for single CSSRule, not CSSStyleSheet?

currently getUrls method could be applied to CSSStyleSheet object only. Is there a simple way to get urls from single CSS rule?
My workaround is like following:

from cssutils import CSSParser
from cssutils.css import CSSStyleRule
from cssutils.css import CSSStyleSheet
from cssutils import getUrls

parser = CSSParser()
style = parser.parseStyle(cssText="height:450px; background-image: url('https://example.com/image.png');")

rule = CSSStyleRule(selectorText="html", style=style)

css = CSSStyleSheet()
css.add(rule)
print(list(getUrls(css)))

but it seems to be a bit over-engineered. Is there a better/faster way?

Hex Colors Being Shortened During parseString()

I was using cssutils to pull color data from a website and came across what I believe to be a bug.

Test Code:

test = ".auto-style5 { width: 250px; color: #FFFFFF; background-color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: x-large; }"
css = cssutils.parseString(test)
for rule in css:
    print(rule)

Result:

<cssutils.css.CSSStyleRule object selectorText='.auto-style5' style='width: 250px;\ncolor: #FFF;\nbackground-color: #000;\nfont-family: Arial, Helvetica, sans-serif;\nfont-size: x-large' _namespaces={} at 0x1063973a0>

color and background-color are shortened from #FFFFFF & #000000 to #FFF & #000 causing issues with my application.

Property Color unset invalid value

I'm only using this Package to validate CSS-Values, but I've stumbled upon the case where a color value is set to 'unset' and the profile validation (cssutils.profile.validate) returns a false for this.

Expected Behavior

cssutils.profile.validate('color', 'unset') is True

Actual Behavior

cssutils.profile.validate('color', 'unset') is False

Docs builds failing with DeprecationWarning

WARNING: 'object' is deprecated for index entries (from entry 'object: cssutils.log'). Use 'pair: object; cssutils.log' instead.
WARNING: 'object' is deprecated for index entries (from entry 'object: cssutils.ser'). Use 'pair: object; cssutils.ser' instead.
WARNING: 'object' is deprecated for index entries (from entry 'object: cssutils.ser.prefs'). Use 'pair: object; cssutils.ser.prefs' instead.

SVG CSS Stylesheet raises numerous errors

Consider the following stylesheet, created from a mermaid output:

#mermaid-1668594191602 {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}
#mermaid-1668594191602 .error-icon{fill:#552222;}
#mermaid-1668594191602 .error-text{fill:#552222;stroke:#552222;}
#mermaid-1668594191602 .edge-thickness-normal{stroke-width:2px;}
#mermaid-1668594191602 .edge-thickness-thick{stroke-width:3.5px;}
#mermaid-1668594191602 .edge-pattern-solid{stroke-dasharray:0;}
#mermaid-1668594191602 .edge-pattern-dashed{stroke-dasharray:3;}
#mermaid-1668594191602 .edge-pattern-dotted{stroke-dasharray:2;}
#mermaid-1668594191602 .marker{fill:#333333;stroke:#333333;}
#mermaid-1668594191602 .marker.cross{stroke:#333333;}
#mermaid-1668594191602 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}
#mermaid-1668594191602 .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}
#mermaid-1668594191602 text.actor&gt;tspan{fill:black;stroke:none;}
#mermaid-1668594191602 .actor-line{stroke:grey;}
#mermaid-1668594191602 .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}
#mermaid-1668594191602 .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}
#mermaid-1668594191602 #arrowhead path{fill:#333;stroke:#333;}
#mermaid-1668594191602 .sequenceNumber{fill:white;}
#mermaid-1668594191602 #sequencenumber{fill:#333;}
#mermaid-1668594191602 #crosshead path{fill:#333;stroke:#333;}
#mermaid-1668594191602 .messageText{fill:#333;}
#mermaid-1668594191602 .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}
#mermaid-1668594191602 .labelText,#mermaid-1668594191602 .labelText&gt;tspan{fill:black;stroke:none;}
#mermaid-1668594191602 .loopText,#mermaid-1668594191602 .loopText&gt;tspan{fill:black;stroke:none;}
#mermaid-1668594191602 .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}
#mermaid-1668594191602 .note{stroke:#aaaa33;fill:#fff5ad;}
#mermaid-1668594191602 .noteText,#mermaid-1668594191602 .noteText&gt;tspan{fill:black;stroke:none;}
#mermaid-1668594191602 .activation0{fill:#f4f4f4;stroke:#666;}
#mermaid-1668594191602 .activation1{fill:#f4f4f4;stroke:#666;}
#mermaid-1668594191602 .activation2{fill:#f4f4f4;stroke:#666;}
#mermaid-1668594191602 .actorPopupMenu{position:absolute;}
#mermaid-1668594191602 .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}
#mermaid-1668594191602 .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}
#mermaid-1668594191602 .actor-man circle,#mermaid-1668594191602 line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}
#mermaid-1668594191602 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}

Parsing it with cssutils returns many errors and warnings, and many rules are not loaded:

cssutils.parseString(css)

WARNING	Property: Unknown Property name. [1:92: fill]
WARNING	Property: Unknown Property name. [2:36: fill]
WARNING	Property: Unknown Property name. [3:36: fill]
WARNING	Property: Unknown Property name. [3:49: stroke]
WARNING	Property: Unknown Property name. [4:47: stroke-width]
WARNING	Property: Unknown Property name. [5:46: stroke-width]
WARNING	Property: Unknown Property name. [6:44: stroke-dasharray]
WARNING	Property: Unknown Property name. [7:45: stroke-dasharray]
WARNING	Property: Unknown Property name. [8:45: stroke-dasharray]
WARNING	Property: Unknown Property name. [9:32: fill]
WARNING	Property: Unknown Property name. [9:45: stroke]
WARNING	Property: Unknown Property name. [10:38: stroke]
WARNING	Property: Unknown Property name. [12:31: stroke]
WARNING	Property: Unknown Property name. [12:90: fill]
ERROR	CSSStyleRule: No start { of style declaration found: '#mermaid-1668594191602 text.actor&gt;' [13:37: ;]
ERROR	Selector: Unexpected CHAR. [13:34: &]
ERROR	Selector: Unexpected IDENT. [13:35: gt]
ERROR	SelectorList: Invalid Selector: #mermaid-1668594191602 text.actor&gt
ERROR	CSSStyleRule: No style declaration or "}" found: '#mermaid-1668594191602 text.actor&gt;'
WARNING	Property: Unknown Property name. [13:44: fill]
WARNING	Property: Unknown Property name. [13:55: stroke]
WARNING	Property: Unknown Property name. [14:36: stroke]
WARNING	Property: Unknown Property name. [15:38: stroke-width]
WARNING	Property: Unknown Property name. [15:55: stroke-dasharray]
WARNING	Property: Unknown Property name. [15:77: stroke]
WARNING	Property: Unknown Property name. [16:38: stroke-width]
WARNING	Property: Unknown Property name. [16:55: stroke-dasharray]
WARNING	Property: Unknown Property name. [16:76: stroke]
WARNING	Property: Unknown Property name. [17:40: fill]
WARNING	Property: Unknown Property name. [17:50: stroke]
WARNING	Property: Unknown Property name. [18:40: fill]
WARNING	Property: Unknown Property name. [19:40: fill]
WARNING	Property: Unknown Property name. [20:40: fill]
WARNING	Property: Unknown Property name. [20:50: stroke]
WARNING	Property: Unknown Property name. [21:37: fill]
WARNING	Property: Unknown Property name. [22:34: stroke]
WARNING	Property: Unknown Property name. [22:93: fill]
ERROR	CSSStyleRule: No start { of style declaration found: '#mermaid-1668594191602 .labelText,#mermaid-1668594191602 .labelText&gt;' [23:71: ;]
ERROR	Selector: Unexpected CHAR. [23:68: &]
ERROR	Selector: Unexpected IDENT. [23:69: gt]
ERROR	SelectorList: Invalid Selector: #mermaid-1668594191602 .labelText&gt
ERROR	CSSStyleRule: No style declaration or "}" found: '#mermaid-1668594191602 .labelText,#mermaid-1668594191602 .labelText&gt;'
WARNING	Property: Unknown Property name. [23:78: fill]
WARNING	Property: Unknown Property name. [23:89: stroke]
ERROR	CSSStyleRule: No start { of style declaration found: '#mermaid-1668594191602 .loopText,#mermaid-1668594191602 .loopText&gt;' [24:69: ;]
ERROR	Selector: Unexpected CHAR. [24:66: &]
ERROR	Selector: Unexpected IDENT. [24:67: gt]
ERROR	SelectorList: Invalid Selector: #mermaid-1668594191602 .loopText&gt
ERROR	CSSStyleRule: No style declaration or "}" found: '#mermaid-1668594191602 .loopText,#mermaid-1668594191602 .loopText&gt;'
WARNING	Property: Unknown Property name. [24:76: fill]
WARNING	Property: Unknown Property name. [24:87: stroke]
WARNING	Property: Unknown Property name. [25:34: stroke-width]
WARNING	Property: Unknown Property name. [25:51: stroke-dasharray]
WARNING	Property: Unknown Property name. [25:72: stroke]
WARNING	Property: Unknown Property name. [25:131: fill]
WARNING	Property: Unknown Property name. [26:30: stroke]
WARNING	Property: Unknown Property name. [26:45: fill]
ERROR	CSSStyleRule: No start { of style declaration found: '#mermaid-1668594191602 .noteText,#mermaid-1668594191602 .noteText&gt;' [27:69: ;]
ERROR	Selector: Unexpected CHAR. [27:66: &]
ERROR	Selector: Unexpected IDENT. [27:67: gt]
ERROR	SelectorList: Invalid Selector: #mermaid-1668594191602 .noteText&gt
ERROR	CSSStyleRule: No style declaration or "}" found: '#mermaid-1668594191602 .noteText,#mermaid-1668594191602 .noteText&gt;'
WARNING	Property: Unknown Property name. [27:76: fill]
WARNING	Property: Unknown Property name. [27:87: stroke]
WARNING	Property: Unknown Property name. [28:37: fill]
WARNING	Property: Unknown Property name. [28:50: stroke]
WARNING	Property: Unknown Property name. [29:37: fill]
WARNING	Property: Unknown Property name. [29:50: stroke]
WARNING	Property: Unknown Property name. [30:37: fill]
WARNING	Property: Unknown Property name. [30:50: stroke]
WARNING	Property: Unknown Property name. [32:63: fill]
WARNING	Property: Unknown Property name. [32:120: filter]
ERROR	COLOR_VALUE: Missing token for production end FUNC ")": ('CHAR', '/', 32, 161)
ERROR	PropertyValue: No match: ('CHAR', ')', 32, 167)
ERROR	PropertyValue: Unknown syntax or no value: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4))
ERROR	CSSStyleDeclaration: Syntax Error in Property: filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4))
WARNING	Property: Unknown Property name. [33:40: stroke]
WARNING	Property: Unknown Property name. [33:99: fill]
WARNING	Property: Unknown Property name. [34:70: stroke]
WARNING	Property: Unknown Property name. [34:129: fill]
WARNING	Property: Unknown Property name. [34:142: stroke-width]
WARNING	Property: Unknown Property name. [35:30: --mermaid-font-family]

CSS file of 320 bytes takes 10+ seconds to parse

I've encountered CSS file which cssutils library takes lots of seconds to parse (in fact, almost infinite).
After some investigation I've minified problematic sample (as possible) and prepared reproducible code example.
On my laptop (core i7-8550U) it takes 14 seconds to parse file with just one line and 320 bytes of text.

Original file has 20kBytes of text and parser does not finish it in several hours.

Code:
https://gist.github.com/vdmit/ef9007170fa1c616cf5aba1fcebfce87
I'm using:

  • latest stable cssutils release 2.3.0 from pypi repo
  • python 3.8.10
  • Ubuntu 20.04 linux distribution.

Notes:

  • original CSS file was malformed and even contained non-printable characters. My minified example is still not valid CSS file, but it is a plain ANSI file.
  • Adding line break in any place fixes problem;
  • Removing of last style expression (.s11... reduces execution time from 14 seconds to 3 seconds).
  • Adding of one more style expression increases execution time from 14 seconds to 50, 2 more styles yields ~260 seconds.

So, there is a exponential complexity somewhere, which is strange.

Traceback of interrupted script is following:

Traceback (most recent call last):
  File "cssutils_infinite_loop_bug_example.py", line 10, in <module>
    sheet = css_parser.parseString(cssText=css_text)
  File "/home/vdmit/.local/lib/python3.8/site-packages/cssutils/parse.py", line 147, in parseString
    sheet._setCssTextWithEncodingOverride(
  File "/home/vdmit/.local/lib/python3.8/site-packages/cssutils/css/cssstylesheet.py", line 408, in _setCssTextWithEncodingOverride
    self.cssText = cssText
  File "/home/vdmit/.local/lib/python3.8/site-packages/cssutils/css/cssstylesheet.py", line 331, in _setCssText
    wellformed, expected = self._parse(
  File "/home/vdmit/.local/lib/python3.8/site-packages/cssutils/util.py", line 484, in _parse
    expected = p(expected, seq, token, tokenizer)
  File "/home/vdmit/.local/lib/python3.8/site-packages/cssutils/css/cssstylesheet.py", line 313, in ruleset
    rule.cssText = self._tokensupto2(tokenizer, token)
  File "/home/vdmit/.local/lib/python3.8/site-packages/cssutils/util.py", line 343, in _tokensupto2
    for token in tokenizer:
  File "/home/vdmit/.local/lib/python3.8/site-packages/cssutils/tokenize2.py", line 172, in tokenize
    match = matcher(text, pos)  # if no match try next production
KeyboardInterrupt

Some tests failing with ImportPathMismatchError

Recently, tests started failing. I suspect the issue was introduced by the introduction of build to checkdocs.

______________________ ERROR collecting examples/build.py ______________________
.tox/python/lib/python3.11/site-packages/_pytest/runner.py:338: in from_call
    result: Optional[TResult] = func()
.tox/python/lib/python3.11/site-packages/_pytest/runner.py:369: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
.tox/python/lib/python3.11/site-packages/_pytest/doctest.py:545: in collect
    module = import_path(
.tox/python/lib/python3.11/site-packages/_pytest/pathlib.py:556: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('build', '/Users/runner/work/cssutils/cssutils/.tox/python/lib/python3.11/site-packages/build', PosixPath('/Users/runner/work/cssutils/cssutils/examples/build.py'))

Revive changes

In the retirement of Bitbucket, some of the source code history was lost. In particular, the releases 1.0.1 and 1.0.2 have no associated history. Let's revive those changes in the repo.

How compatible to 1.0 is the 2.4 version?

Hi,

Debian and Ubuntu have been shipping 1.0 for the past ~5 years and now there's a new build failure with it. Unsurprisingly, it looks fixed in the versions here.

Considering how many years separate these two versions, I'd like to know how compatible these two versions are. I also tried reaching @cthedot by e-mail but that bounced.

Thanks. :)

Docs builds failing

The docs builds are failing with a host of warnings:

WARNING: error while formatting arguments for cssutils.css.CSSStyleSheet.namespaces: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSStyleSheet.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSRuleList.length: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSCharsetRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSCharsetRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSFontFaceRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSFontFaceRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSImportRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSImportRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSMediaRule.name: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSMediaRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSMediaRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSNamespaceRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSNamespaceRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSPageRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSPageRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.MarginRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.MarginRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSStyleRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSStyleRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSVariablesRule.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSVariablesRule.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSComment.parent: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSComment.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.Selector.element: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.Selector.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSVariablesDeclaration.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSStyleDeclaration.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.Property.priority: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.PropertyValue.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.Value.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.ColorValue.alpha: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.ColorValue.blue: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.ColorValue.green: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.ColorValue.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.ColorValue.type: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.DimensionValue.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.URIValue.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSFunction.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSCalc.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSVariable.fallback: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.CSSVariable.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.css.MSValue.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.profiles.Profiles.knownNames: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.stylesheets.StyleSheet.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.stylesheets.MediaQuery.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))
WARNING: error while formatting arguments for cssutils.stylesheets.MediaList.seq: Handler <function update_defvalue at 0x10614c0e0> for event 'autodoc-before-process-signature' threw an exception (exception: invalid syntax. Maybe you meant '==' or ':=' instead of '='? (<unknown>, line 2))

2.9.0: pytest fails in 5 units

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix> using installer module
  • run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
  • build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")
Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.9.0-2.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.9.0-2.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0
configfile: pytest.ini
plugins: jaraco.test-5.3.0
collected 456 items

cssutils/__init__.py .                                                   [  0%]
cssutils/css/cssstyledeclaration.py ....                                 [  1%]
cssutils/tests/test_codec.py ......                                      [  2%]
cssutils/tests/test_csscharsetrule.py ..........                         [  4%]
cssutils/tests/test_csscomment.py .......                                [  6%]
cssutils/tests/test_cssfontfacerule.py ...........                       [  8%]
cssutils/tests/test_cssimportrule.py ..............                      [ 11%]
cssutils/tests/test_cssmediarule.py .................                    [ 15%]
cssutils/tests/test_cssnamespacerule.py ..........                       [ 17%]
cssutils/tests/test_csspagerule.py ..............                        [ 20%]
cssutils/tests/test_cssproperties.py ...                                 [ 21%]
cssutils/tests/test_cssrule.py ....                                      [ 22%]
cssutils/tests/test_cssrulelist.py ..                                    [ 22%]
cssutils/tests/test_cssstyledeclaration.py ........................      [ 27%]
cssutils/tests/test_cssstylerule.py ............                         [ 30%]
cssutils/tests/test_cssstylesheet.py ............................        [ 36%]
cssutils/tests/test_cssunknownrule.py .......                            [ 38%]
cssutils/tests/test_cssutils.py ........                                 [ 39%]
cssutils/tests/test_cssutilsimport.py .                                  [ 40%]
cssutils/tests/test_cssvalue.py xxxxXxxxxxxxxxxxxxxxx                    [ 44%]
cssutils/tests/test_cssvariablesdeclaration.py .........                 [ 46%]
cssutils/tests/test_cssvariablesrule.py ..........                       [ 48%]
cssutils/tests/test_domimplementation.py FFFF                            [ 49%]
cssutils/tests/test_encutils.py .......                                  [ 51%]
cssutils/tests/test_errorhandler.py ....                                 [ 52%]
cssutils/tests/test_helper.py .....                                      [ 53%]
cssutils/tests/test_marginrule.py ........                               [ 55%]
cssutils/tests/test_medialist.py .........                               [ 57%]
cssutils/tests/test_mediaquery.py ....                                   [ 57%]
cssutils/tests/test_parse.py ..............                              [ 60%]
cssutils/tests/test_prodparser.py .................                      [ 64%]
cssutils/tests/test_profiles.py ........xxxxxx.............xxxxx         [ 71%]
cssutils/tests/test_properties.py ..                                     [ 72%]
cssutils/tests/test_property.py ........                                 [ 73%]
cssutils/tests/test_scripts_csscombine.py ..                             [ 74%]
cssutils/tests/test_selector.py ........                                 [ 76%]
cssutils/tests/test_selectorlist.py .....                                [ 77%]
cssutils/tests/test_serialize.py .............................           [ 83%]
cssutils/tests/test_settings.py .                                        [ 83%]
cssutils/tests/test_stylesheet.py .                                      [ 83%]
cssutils/tests/test_tokenize2.py .............                           [ 86%]
cssutils/tests/test_util.py .....................                        [ 91%]
cssutils/tests/test_value.py .F...................xxxxxxxxxx             [ 98%]
cssutils/tests/test_x.py x                                               [ 98%]
encutils/__init__.py .                                                   [ 98%]
examples/website.py ......                                               [100%]

=================================== FAILURES ===================================
________________ TestDOMImplementation.test_createCSSStyleSheet ________________

self = <cssutils.tests.test_domimplementation.TestDOMImplementation object at 0x7f1f7670d070>

    def test_createCSSStyleSheet(self):
        "DOMImplementationCSS.createCSSStyleSheet()"
        title, media = 'Test Title', cssutils.stylesheets.MediaList('all')
        with warnings.catch_warnings():
            warnings.simplefilter('ignore')
>           sheet = self.domimpl.createCSSStyleSheet(title, media)
E           AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_domimplementation.py:19: AttributeError
__________________ TestDOMImplementation.test_createDocument ___________________

self = <cssutils.tests.test_domimplementation.TestDOMImplementation object at 0x7f1f7670dd30>

    def test_createDocument(self):
        "DOMImplementationCSS.createDocument()"
>       doc = self.domimpl.createDocument(None, None, None)
E       AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_domimplementation.py:26: AttributeError
________________ TestDOMImplementation.test_createDocumentType _________________

self = <cssutils.tests.test_domimplementation.TestDOMImplementation object at 0x7f1f7670d280>

    def test_createDocumentType(self):
        "DOMImplementationCSS.createDocumentType()"
>       doctype = self.domimpl.createDocumentType('foo', 'bar', 'raboof')
E       AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_domimplementation.py:31: AttributeError
____________________ TestDOMImplementation.test_hasFeature _____________________

self = <cssutils.tests.test_domimplementation.TestDOMImplementation object at 0x7f1f76b2f640>

    def test_hasFeature(self):
        "DOMImplementationCSS.hasFeature()"
        tests = [
            ('css', '1.0'),
            ('css', '2.0'),
            ('stylesheets', '1.0'),
            ('stylesheets', '2.0'),
        ]
        for name, version in tests:
>           assert self.domimpl.hasFeature(name, version)
E           AttributeError: 'TestDOMImplementation' object has no attribute 'domimpl'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_domimplementation.py:43: AttributeError
________________________ TestPropertyValue.test_cssText ________________________

self = <cssutils.tests.test_value.TestPropertyValue object at 0x7f1f7603b9d0>

    def test_cssText(self):
        "PropertyValue.cssText"
        tests = {
            '0': (None, 1, None),
            '0 0': (None, 2, None),
            '0, 0': (None, 2, None),
            '0,0': ('0, 0', 2, None),
            '0  ,   0': ('0, 0', 2, None),
            '0/0': (None, 2, None),
            '/**/ 0 /**/': (None, 1, '0'),
            '0 /**/ 0 /**/ 0': (None, 3, '0 0 0'),
            '0, /**/ 0, /**/ 0': (None, 3, '0, 0, 0'),
            '0//**/ 0//**/ 0': (None, 3, '0/0/0'),
            '/**/ red': (None, 1, 'red'),
            '/**/red': ('/**/ red', 1, 'red'),
            'red /**/': (None, 1, 'red'),
            'red/**/': ('red /**/', 1, 'red'),
            'a()1,-1,+1,1%,-1%,1px,-1px,"a",a,url(a),#aabb44': (
                'a() 1, -1, +1, 1%, -1%, 1px, -1px, "a", a, url(a), #ab4',
                12,
                'a() 1, -1, +1, 1%, -1%, 1px, -1px, "a", a, url(a), #ab4',
            ),
            # calc values
            'calc(1)': (None, 1, 'calc(1)'),
            'calc( 1)': ('calc(1)', 1, 'calc(1)'),
            'calc(1 )': ('calc(1)', 1, 'calc(1)'),
            'calc(1px)': (None, 1, 'calc(1px)'),
            'calc(1p-x-)': (None, 1, 'calc(1p-x-)'),
            'calc(1%)': (None, 1, 'calc(1%)'),
            'calc(-1)': (None, 1, 'calc(-1)'),
            'calc(+1)': (None, 1, 'calc(+1)'),
            'calc(1  +   1px)': ('calc(1 + 1px)', 1, 'calc(1 + 1px)'),
            'calc(1 - 1px)': (None, 1, 'calc(1 - 1px)'),
            'calc(1*1px)': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
            'calc(1  /  1px)': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
            'calc( 1*1px)': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
            'calc( 1  /  1px)': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
            'calc(1*1px )': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
            'calc(1  /  1px )': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
            'calc( 1*1px )': ('calc(1 * 1px)', 1, 'calc(1 * 1px)'),
            'calc( 1  /  1px )': ('calc(1 / 1px)', 1, 'calc(1 / 1px)'),
            'calc(calc(1px + 5px) * 4)': (
                'calc(calc(1px + 5px) * 4)',
                1,
                'calc(calc(1px + 5px) * 4)',
            ),
            'calc( calc(1px + 5px)*4 )': (
                'calc(calc(1px + 5px) * 4)',
                1,
                'calc(calc(1px + 5px) * 4)',
            ),
            'calc(var(X))': (None, 1, None),
            'calc(2 * var(X))': (None, 1, None),
            'calc(2px + var(X))': (None, 1, None),
            # issue #24
            'rgb(0, 10, 255)': (None, 1, 'rgb(0, 10, 255)'),
            'hsl(10, 10%, 25%)': (None, 1, 'hsl(10, 10%, 25%)'),
            'rgba(0, 10, 255, 0.5)': (None, 1, 'rgba(0, 10, 255, 0.5)'),
            'hsla(10, 10%, 25%, 0.5)': (None, 1, 'hsla(10, 10%, 25%, 0.5)'),
            # issue #27
            'matrix(0.000092, 0.2500010, -0.250000, 0.000092, 0, 0)': (
                'matrix(0.000092, 0.250001, -0.25, 0.000092, 0, 0)',
                1,
                'matrix(0.000092, 0.250001, -0.25, 0.000092, 0, 0)',
            ),
        }
        for cssText, (c, len, v) in list(tests.items()):
            if c is None:
                c = cssText
            if v is None:
                v = c

            pv = cssutils.css.PropertyValue(cssText)
            assert c == pv.cssText
            assert len == pv.length
            assert v == pv.value

        tests = {
            '0 0px -0px +0px': ('0 0 0 0', 4),
            '1 2 3 4': (None, 4),
            '-1 -2 -3 -4': (None, 4),
            '-1 2': (None, 2),
            '-1px red "x"': (None, 3),
            'a, b c': (None, 3),
            '1px1 2% 3': ('1px1 2% 3', 3),
            'f(+1pX, -2, 5%) 1': ('f(+1px, -2, 5%) 1', 2),
            '0 f()0': ('0 f() 0', 3),
            'f()0': ('f() 0', 2),
            'f()1%': ('f() 1%', 2),
            'f()1px': ('f() 1px', 2),
            'f()"str"': ('f() "str"', 2),
            'f()ident': ('f() ident', 2),
            'f()#123': ('f() #123', 2),
            'f()url()': ('f() url()', 2),
            'f()f()': ('f() f()', 2),
            'url(x.gif)0 0': ('url(x.gif) 0 0', 3),
            'url(x.gif)no-repeat': ('url(x.gif) no-repeat', 2),
        }
        for cssText, (c, len) in list(tests.items()):
            if c is None:
                c = cssText
            pv = cssutils.css.PropertyValue(cssText)
            assert c == pv.cssText
            assert len == pv.length

        tests = {
            # hash and rgb/a
            '#112234': '#112234',
            '#112233': '#123',
            'rgb(1,2,3)': 'rgb(1, 2, 3)',
            'rgb(  1  ,  2  ,  3  )': 'rgb(1, 2, 3)',
            'rgba(1,2,3,4)': 'rgba(1, 2, 3, 4)',
            'rgba(  1  ,  2  ,  3  ,  4 )': 'rgba(1, 2, 3, 4)',
            'rgb(-1,+2,0)': 'rgb(-1, +2, 0)',
            'rgba(-1,+2,0, 0)': 'rgba(-1, +2, 0, 0)',
            # FUNCTION
            'f(1,2)': 'f(1, 2)',
            'f(  1  ,  2  )': 'f(1, 2)',
            'f(-1,+2)': 'f(-1, +2)',
            'f(  -1  ,  +2  )': 'f(-1, +2)',
            'fun(  -1  ,  +2  )': 'fun(-1, +2)',
            'local( x )': 'local(x)',
            'test(1px, #111, y, 1, 1%, "1", y(), var(x))': 'test(1px, #111, y, 1, 1%, "1", y(), var(x))',
            'test(-1px, #111, y, -1, -1%, "1", -y())': 'test(-1px, #111, y, -1, -1%, "1", -y())',
            'url(y)  format( "x" ,  "y" )': 'url(y) format("x", "y")',
            'f(1 2,3 4)': 'f(1 2, 3 4)',
            # IE expression
            r'Expression()': 'Expression()',
            r'expression(-1 < +2)': 'expression(-1<+2)',
            r'expression(document.width == "1")': 'expression(document.width=="1")',
            'alpha(opacity=80)': 'alpha(opacity=80)',
            'alpha( opacity = 80 , x=2  )': 'alpha(opacity=80, x=2)',
            'expression(eval(document.documentElement.scrollTop))': 'expression(eval(document.documentElement.scrollTop))',
            # TODO
            #            u'expression((function(ele){ele.style.behavior="none";})(this))':
            #                u'expression((function(ele){ele.style.behavior="none";})(this))',
            # unicode-range
            'u+f': 'u+f',
            'U+ABCdef': 'u+abcdef',
            # url
            'url(a)': 'url(a)',
            'uRl(a)': 'url(a)',
            'u\\rl(a)': 'url(a)',
            'url("a")': 'url(a)',
            'url(  "a"  )': 'url(a)',
            'url(";")': 'url(";")',
            'url(",")': 'url(",")',
            'url(")")': 'url(")")',
            '''url("'")''': '''url("'")''',
            '''url('"')''': '''url("\\"")''',
            # operator
            '1': '1',
            '1 2': '1 2',
            '1   2': '1 2',
            '1,2': '1, 2',
            '1,  2': '1, 2',
            '1  ,2': '1, 2',
            '1  ,  2': '1, 2',
            '1/2': '1/2',
            '1/  2': '1/2',
            '1  /2': '1/2',
            '1  /  2': '1/2',
            # comment
            '1/**/2': '1 /**/ 2',
            '1 /**/2': '1 /**/ 2',
            '1/**/ 2': '1 /**/ 2',
            '1 /**/ 2': '1 /**/ 2',
            '1  /*a*/  /*b*/  2': '1 /*a*/ /*b*/ 2',
            # , before
            '1,/**/2': '1, /**/ 2',
            '1 ,/**/2': '1, /**/ 2',
            '1, /**/2': '1, /**/ 2',
            '1 , /**/2': '1, /**/ 2',
            # , after
            '1/**/,2': '1 /**/, 2',
            '1/**/ ,2': '1 /**/, 2',
            '1/**/, 2': '1 /**/, 2',
            '1/**/ , 2': '1 /**/, 2',
            # all
            '1/*a*/  ,/*b*/  2': '1 /*a*/, /*b*/ 2',
            '1  /*a*/,  /*b*/2': '1 /*a*/, /*b*/ 2',
            '1  /*a*/  ,  /*b*/  2': '1 /*a*/, /*b*/ 2',
            # list
            'a b1,b2 b2,b3,b4': 'a b1, b2 b2, b3, b4',
            'a b1  ,   b2   b2  ,  b3  ,   b4': 'a b1, b2 b2, b3, b4',
            'u+1  ,   u+2-5': 'u+1, u+2-5',
            'local( x ),  url(y)  format( "x" ,  "y" )': 'local(x), url(y) format("x", "y")',
            # FUNCTION
            'attr( href )': 'attr(href)',
            # PrinceXML extende FUNC syntax with nested FUNC
            'target-counter(attr(href),page)': 'target-counter(attr(href), page)',
        }
>       self.do_equal_r(tests)

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:230:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <cssutils.tests.test_value.TestPropertyValue object at 0x7f1f7603b9d0>
tests = {'#112233': '#123', '#112234': '#112234', '1': '1', '1   2': '1 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: 'TestPropertyValue' object has no attribute 'r'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/basetest.py:41: AttributeError
================================== XFAILURES ===================================
____________________________ TestCSSValue.test_init ____________________________

self = <cssutils.tests.test_cssvalue.TestCSSValue object at 0x7f1f7638a550>

    def test_init(self):
        "CSSValue.__init__()"
>       v = cssutils.css.CSSValue()
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:20: AttributeError
__________________________ TestCSSValue.test_escapes ___________________________

self = <cssutils.tests.test_cssvalue.TestCSSValue object at 0x7f1f7638a760>

    def test_escapes(self):
        "CSSValue Escapes"
>       v = cssutils.css.CSSValue()
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:27: AttributeError
__________________________ TestCSSValue.test_cssText ___________________________

self = <cssutils.tests.test_cssvalue.TestCSSValue object at 0x7f1f76b39af0>

    def test_cssText(self):
        "CSSValue.cssText"
>       v = cssutils.css.CSSValue()
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:45: AttributeError
__________________________ TestCSSValue.test_cssText2 __________________________

self = <cssutils.tests.test_cssvalue.TestCSSValue object at 0x7f1f767f6d30>

        def test_cssText2(self):
            "CSSValue.cssText 2"
            tests = {
                # mix
                'a()1,-1,+1,1%,-1%,1px,-1px,"a",a,url(a),#aabb44': 'a() 1, -1, 1, 1%, -1%, 1px, -1px, "a", a, url(a), #ab4',
                # S or COMMENT
                'red': 'red',
                'red ': 'red',
                ' red ': 'red',
                '/**/red': '/**/ red',
                'red/**/': 'red /**/',
                '/**/red/**/': '/**/ red /**/',
                '/**/ red': '/**/ red',
                'red /**/': 'red /**/',
                '/**/ red /**/': '/**/ red /**/',
                'red-': 'red-',
                # num / dimension
                '.0': '0',
                '0': '0',
                '0.0': '0',
                '00': '0',
                '0%': '0%',
                '0px': '0',
                '-.0': '0',
                '-0': '0',
                '-0.0': '0',
                '-00': '0',
                '-0%': '0%',
                '-0px': '0',
                '+.0': '0',
                '+0': '0',
                '+0.0': '0',
                '+00': '0',
                '+0%': '0%',
                '+0px': '0',
                '1': '1',
                '1.0': '1',
                '1px': '1px',
                '1%': '1%',
                '1px1': '1px1',
                '+1': '1',
                '-1': '-1',
                '+1.0': '1',
                '-1.0': '-1',
                # string, escaped nl is removed during tokenizing
                '"x"': '"x"',
                "'x'": '"x"',
                # ur''' "1\'2" ''': u'''"1'2"''', #???
                # ur"'x\"'": ur'"x\""', #???
                r'''"x\
    y"''': '''"xy"''',
                # hash and rgb/a
                '#112234': '#112234',
                '#112233': '#123',
                'rgb(1,2,3)': 'rgb(1, 2, 3)',
                'rgb(  1  ,  2  ,  3  )': 'rgb(1, 2, 3)',
                'rgb(-1,+2,0)': 'rgb(-1, 2, 0)',
                'rgba(1,2,3,4)': 'rgba(1, 2, 3, 4)',
                'rgba(  1  ,  2  ,  3  ,  4 )': 'rgba(1, 2, 3, 4)',
                'rgba(-1,+2,0, 0)': 'rgba(-1, 2, 0, 0)',
                # FUNCTION
                'f(1,2)': 'f(1, 2)',
                'f(  1  ,  2  )': 'f(1, 2)',
                'f(-1,+2)': 'f(-1, 2)',
                'f(  -1  ,  +2  )': 'f(-1, 2)',
                'fun(  -1  ,  +2  )': 'fun(-1, 2)',
                'local( x )': 'local(x)',
                'test(1px, #111, y, 1, 1%, "1", y(), var(x))': 'test(1px, #111, y, 1, 1%, "1", y(), var(x))',
                'test(-1px, #111, y, -1, -1%, "1", -y())': 'test(-1px, #111, y, -1, -1%, "1", -y())',
                'url(y)  format( "x" ,  "y" )': 'url(y) format("x", "y")',
                'f(1 2,3 4)': 'f(1 2, 3 4)',
                # IE expression
                r'Expression()': 'Expression()',
                r'expression(-1 < +2)': 'expression(-1< + 2)',
                r'expression(document.width == "1")': 'expression(document.width=="1")',
                'alpha(opacity=80)': 'alpha(opacity=80)',
                'alpha( opacity = 80 , x=2  )': 'alpha(opacity=80, x=2)',
                # unicode-range
                'u+f': 'u+f',
                'U+ABCdef': 'u+abcdef',
                # url
                'url(a)': 'url(a)',
                'uRl(a)': 'url(a)',
                'u\\rl(a)': 'url(a)',
                'url("a")': 'url(a)',
                'url(  "a"  )': 'url(a)',
                'url(";")': 'url(";")',
                'url(",")': 'url(",")',
                'url(")")': 'url(")")',
                '''url("'")''': '''url("'")''',
                '''url('"')''': '''url("\\"")''',
                '1 2': '1 2',
                '1   2': '1 2',
                '1,2': '1, 2',
                '1,  2': '1, 2',
                '1  ,2': '1, 2',
                '1  ,  2': '1, 2',
                '1/2': '1/2',
                '1/  2': '1/2',
                '1  /2': '1/2',
                '1  /  2': '1/2',
                # comment
                '1/**/2': '1 /**/ 2',
                '1 /**/2': '1 /**/ 2',
                '1/**/ 2': '1 /**/ 2',
                '1 /**/ 2': '1 /**/ 2',
                '1  /*a*/  /*b*/  2': '1 /*a*/ /*b*/ 2',
                # , before
                '1,/**/2': '1, /**/ 2',
                '1 ,/**/2': '1, /**/ 2',
                '1, /**/2': '1, /**/ 2',
                '1 , /**/2': '1, /**/ 2',
                # , after
                '1/**/,2': '1 /**/, 2',
                '1/**/ ,2': '1 /**/, 2',
                '1/**/, 2': '1 /**/, 2',
                '1/**/ , 2': '1 /**/, 2',
                # all
                '1/*a*/  ,/*b*/  2': '1 /*a*/, /*b*/ 2',
                '1  /*a*/,  /*b*/2': '1 /*a*/, /*b*/ 2',
                '1  /*a*/  ,  /*b*/  2': '1 /*a*/, /*b*/ 2',
                # list
                'a b1,b2 b2,b3,b4': 'a b1, b2 b2, b3, b4',
                'a b1  ,   b2   b2  ,  b3  ,   b4': 'a b1, b2 b2, b3, b4',
                'u+1  ,   u+2-5': 'u+1, u+2-5',
                'local( x ),  url(y)  format( "x" ,  "y" )': 'local(x), url(y) format("x", "y")',
                # FUNCTION
                'attr( href )': 'attr(href)',
                # PrinceXML extende FUNC syntax with nested FUNC
                'target-counter(attr(href),page)': 'target-counter(attr(href), page)',
            }

>           self.do_equal_r(tests)

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:230:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <cssutils.tests.test_cssvalue.TestCSSValue object at 0x7f1f767f6d30>
tests = {' red ': 'red', '"x"': '"x"', '"x\\\ny"': '"xy"', '#112233': '#123', ...}
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: 'TestCSSValue' object has no attribute 'r'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/basetest.py:41: AttributeError
________________________ TestCSSValue.test_cssValueType ________________________

self = <cssutils.tests.test_cssvalue.TestCSSValue object at 0x7f1f763cebe0>

    def test_cssValueType(self):
        "CSSValue.cssValueType .cssValueTypeString"
        tests = [
>           (['inherit', 'INhe\\rit'], 'CSS_INHERIT', cssutils.css.CSSValue),
            (
                [
                    '1',
                    '1%',
                    '1em',
                    '1ex',
                    '1px',
                    '1cm',
                    '1mm',
                    '1in',
                    '1pt',
                    '1pc',
                    '1deg',
                    '1rad',
                    '1grad',
                    '1ms',
                    '1s',
                    '1hz',
                    '1khz',
                    '1other',
                    '"string"',
                    "'string'",
                    'url(x)',
                    'red',
                    'attr(a)',
                    'counter(x)',
                    'rect(1px, 2px, 3px, 4px)',
                    'rgb(0, 0, 0)',
                    '#000',
                    '#123456',
                    'rgba(0, 0, 0, 0)',
                    'hsl(0, 0, 0)',
                    'hsla(0, 0, 0, 0)',
                ],
                'CSS_PRIMITIVE_VALUE',
                cssutils.css.CSSPrimitiveValue,
            ),
            (
                ['1px 1px', 'red blue green x'],
                'CSS_VALUE_LIST',
                cssutils.css.CSSValueList,
            ),
            # what is a custom value?
            # ([], 'CSS_CUSTOM', cssutils.css.CSSValue)
        ]
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:279: AttributeError
__________________________ TestCSSValue.test_readonly __________________________

self = <cssutils.tests.test_cssvalue.TestCSSValue object at 0x7f1f763ce250>

    def test_readonly(self):
        "(CSSValue._readonly)"
>       v = cssutils.css.CSSValue(cssText='inherit')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:338: AttributeError
_________________________ TestCSSValue.test_reprANDstr _________________________

self = <cssutils.tests.test_cssvalue.TestCSSValue object at 0x7f1f763ce430>

    def test_reprANDstr(self):
        "CSSValue.__repr__(), .__str__()"
        cssText = 'inherit'

>       s = cssutils.css.CSSValue(cssText=cssText)
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:352: AttributeError
_______________________ TestCSSPrimitiveValue.test_init ________________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f763ce820>

    def test_init(self):
        "CSSPrimitiveValue.__init__()"
>       v = cssutils.css.CSSPrimitiveValue('1')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:364: AttributeError
____________________ TestCSSPrimitiveValue.test_CSS_UNKNOWN ____________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f763ceac0>

    def test_CSS_UNKNOWN(self):
        "CSSPrimitiveValue.CSS_UNKNOWN"
>       v = cssutils.css.CSSPrimitiveValue('expression(false)')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:387: AttributeError
__________ TestCSSPrimitiveValue.test_CSS_NUMBER_AND_OTHER_DIMENSIONS __________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f763cee50>

    def test_CSS_NUMBER_AND_OTHER_DIMENSIONS(self):
        "CSSPrimitiveValue.CSS_NUMBER .. CSS_DIMENSION"
        defs = [
            ('', 'CSS_NUMBER'),
            ('%', 'CSS_PERCENTAGE'),
            ('em', 'CSS_EMS'),
            ('ex', 'CSS_EXS'),
            ('px', 'CSS_PX'),
            ('cm', 'CSS_CM'),
            ('mm', 'CSS_MM'),
            ('in', 'CSS_IN'),
            ('pt', 'CSS_PT'),
            ('pc', 'CSS_PC'),
            ('deg', 'CSS_DEG'),
            ('rad', 'CSS_RAD'),
            ('grad', 'CSS_GRAD'),
            ('ms', 'CSS_MS'),
            ('s', 'CSS_S'),
            ('hz', 'CSS_HZ'),
            ('khz', 'CSS_KHZ'),
            ('other_dimension', 'CSS_DIMENSION'),
        ]
        for dim, name in defs:
            for n in (0, 1, 1.1, -1, -1.1, -0):
>               v = cssutils.css.CSSPrimitiveValue('%i%s' % (n, dim))
E               AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:415: AttributeError
_______________ TestCSSPrimitiveValue.test_CSS_STRING_AND_OTHER ________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f76af17f0>

    def test_CSS_STRING_AND_OTHER(self):
        "CSSPrimitiveValue.CSS_STRING .. CSS_RGBCOLOR"
        defs = [
            (
                (
                    '""',
                    "''",
                    '"some thing"',
                    "' A\\ND '",
                    # comma separated lists are STRINGS FOR NOW!
                    'a, b',
                    '"a", "b"',
                ),
                'CSS_STRING',
            ),
            (('url(a)', 'url("a b")', "url(' ')"), 'CSS_URI'),
            (('some', 'or_anth-er'), 'CSS_IDENT'),
            (('attr(a)', 'attr(b)'), 'CSS_ATTR'),
            (('counter(1)', 'counter(2)'), 'CSS_COUNTER'),
            (('rect(1,2,3,4)',), 'CSS_RECT'),
            (('rgb(1,2,3)', 'rgb(10%, 20%, 30%)', '#123', '#123456'), 'CSS_RGBCOLOR'),
            (
                (
                    'rgba(1,2,3,4)',
                    'rgba(10%, 20%, 30%, 40%)',
                ),
                'CSS_RGBACOLOR',
            ),
            (('U+0', 'u+ffffff', 'u+000000-f', 'u+0-f, U+ee-ff'), 'CSS_UNICODE_RANGE'),
        ]

        for examples, name in defs:
            for x in examples:
>               v = cssutils.css.CSSPrimitiveValue(x)
E               AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:452: AttributeError
_____________________ TestCSSPrimitiveValue.test_getFloat ______________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f76703f70>

    def test_getFloat(self):
        "CSSPrimitiveValue.getFloatValue()"
        # NOT TESTED are float values as it seems difficult to
        # compare these. Maybe use decimal.Decimal?

>       v = cssutils.css.CSSPrimitiveValue('1px')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:461: AttributeError
_____________________ TestCSSPrimitiveValue.test_setFloat ______________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f76703b50>

    def test_setFloat(self):
        "CSSPrimitiveValue.setFloatValue()"
>       V = cssutils.css.CSSPrimitiveValue
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:505: AttributeError
_____________________ TestCSSPrimitiveValue.test_getString _____________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f76703ee0>

    def test_getString(self):
        "CSSPrimitiveValue.getStringValue()"
>       v = cssutils.css.CSSPrimitiveValue('1px')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:656: AttributeError
_____________________ TestCSSPrimitiveValue.test_setString _____________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f767037f0>

    def test_setString(self):
        "CSSPrimitiveValue.setStringValue()"
        # CSS_STRING
>       v = cssutils.css.CSSPrimitiveValue('"a"')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:684: AttributeError
___________________ TestCSSPrimitiveValue.test_typeRGBColor ____________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f76703730>

    def test_typeRGBColor(self):
        "RGBColor"
>       v = cssutils.css.CSSPrimitiveValue('RGB(1, 5, 10)')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:820: AttributeError
____________________ TestCSSPrimitiveValue.test_reprANDstr _____________________

self = <cssutils.tests.test_cssvalue.TestCSSPrimitiveValue object at 0x7f1f76703880>

    def test_reprANDstr(self):
        "CSSPrimitiveValue.__repr__(), .__str__()"
        v = '111'

>       s = cssutils.css.CSSPrimitiveValue(v)
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:843: AttributeError
__________________________ TestCSSValueList.test_init __________________________

self = <cssutils.tests.test_cssvalue.TestCSSValueList object at 0x7f1f763cebb0>

    def test_init(self):
        "CSSValueList.__init__()"
>       v = cssutils.css.CSSValue(cssText='red blue')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:856: AttributeError
________________________ TestCSSValueList.test_numbers _________________________

self = <cssutils.tests.test_cssvalue.TestCSSValueList object at 0x7f1f76865130>

    def test_numbers(self):
        "CSSValueList.cssText"
        tests = {
            '0 0px -0px +0px': ('0 0 0 0', 4),
            '1 2 3 4': (None, 4),
            '-1 -2 -3 -4': (None, 4),
            '-1 2': (None, 2),
            '-1px red "x"': (None, 3),
            'a, b c': (None, 2),
            '1px1 2% 3': ('1px1 2% 3', 3),
            'f(+1pX, -2, 5%) 1': ('f(1px, -2, 5%) 1', 2),
            '0 f()0': ('0 f() 0', 3),
            'f()0': ('f() 0', 2),
            'f()1%': ('f() 1%', 2),
            'f()1px': ('f() 1px', 2),
            'f()"str"': ('f() "str"', 2),
            'f()ident': ('f() ident', 2),
            'f()#123': ('f() #123', 2),
            'f()url()': ('f() url()', 2),
            'f()f()': ('f() f()', 2),
            'url(x.gif)0 0': ('url(x.gif) 0 0', 3),
            'url(x.gif)no-repeat': ('url(x.gif) no-repeat', 2),
        }
        for test in tests:
            exp, num = tests[test]
            if not exp:
                exp = test
>           v = cssutils.css.CSSValue(cssText=test)
E           AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:893: AttributeError
_______________________ TestCSSValueList.test_reprANDstr _______________________

self = <cssutils.tests.test_cssvalue.TestCSSValueList object at 0x7f1f7638a220>

    def test_reprANDstr(self):
        "CSSValueList.__repr__(), .__str__()"
        v = '1px 2px'

>       s = cssutils.css.CSSValue(v)
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_cssvalue.py:902: AttributeError
___________ TestProfiles.test_validateWithProfile[params3-results3] ____________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f767128e0>
params = ('color', 'rgba(0,0,0,0)', None)
results = (True, True, ['CSS Color Module Level 3'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (True, True, ...S Level 2.1']) == (True, True, ...ule Level 3'])
E
E         At index 2 diff: ['CSS Level 2.1'] != ['CSS Color Module Level 3']
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:232: AssertionError
___________ TestProfiles.test_validateWithProfile[params4-results4] ____________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f76712160>
params = ('color', 'rgba(0,0,0,0)', 'CSS Level 2.1')
results = (True, False, ['CSS Color Module Level 3'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (True, True, ...S Level 2.1']) == (True, False,...ule Level 3'])
E
E         At index 1 diff: True != False
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:232: AssertionError
___________ TestProfiles.test_validateWithProfile[params5-results5] ____________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f767122e0>
params = ('color', 'rgba(0,0,0,0)', 'CSS Color Module Level 3')
results = (True, True, ['CSS Color Module Level 3'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (True, False,...S Level 2.1']) == (True, True, ...ule Level 3'])
E
E         At index 1 diff: False != True
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:232: AssertionError
___________ TestProfiles.test_validateWithProfile[params6-results6] ____________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f767129a0>
params = ('color', '1px', None)
results = (False, False, ['CSS Color Module Level 3', 'CSS Level 2.1'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
E
E         At index 2 diff: ['CSS Level 2.1'] != ['CSS Color Module Level 3', 'CSS Level 2.1']
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:232: AssertionError
___________ TestProfiles.test_validateWithProfile[params7-results7] ____________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f76712520>
params = ('color', '1px', 'CSS Level 2.1')
results = (False, False, ['CSS Color Module Level 3', 'CSS Level 2.1'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
E
E         At index 2 diff: ['CSS Level 2.1'] != ['CSS Color Module Level 3', 'CSS Level 2.1']
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:232: AssertionError
___________ TestProfiles.test_validateWithProfile[params8-results8] ____________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f76712f40>
params = ('color', '1px', 'CSS Color Module Level 3')
results = (False, False, ['CSS Color Module Level 3', 'CSS Level 2.1'])

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    def test_validateWithProfile(self, params, results):
        "Profiles.validate(), Profiles.validateWithProfile()"
        p = cssutils.profiles.Profiles()
        assert p.validate(*params[:2]) == results[0]
>       assert p.validateWithProfile(*params) == results
E       AssertionError: assert (False, False...S Level 2.1']) == (False, False...S Level 2.1'])
E
E         At index 2 diff: ['CSS Level 2.1'] != ['CSS Color Module Level 3', 'CSS Level 2.1']
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:232: AssertionError
________ TestProfiles.test_validateWithProfile_fonts[params0-results0] _________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f763aed00>
params = (('CSS Fonts Module Level 3 @font-face properties',), 'font-family', ('y', '"y"'))
results = (True, True, ('CSS Fonts Module Level 3 @font-face properties',))

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    @pytest.mark.xfail(reason="#37")
    def test_validateWithProfile_fonts(self, params, results):
        "Profiles.validateWithProfile()"
        # testing for valid values overwritten in a profile
        v, m, p = results
        expected = v, m, list(p)
>       assert cssutils.profile.validateWithProfile(*params) == expected
E       AssertionError: assert (False, False, []) == (True, True, ... properties'])
E
E         At index 0 diff: False != True
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:740: AssertionError
________ TestProfiles.test_validateWithProfile_fonts[params1-results1] _________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f763ae820>
params = (('CSS Fonts Module Level 3 @font-face properties',), 'font-family', ('"y", "a"', 'a, b', 'a a'))
results = (True, False, ('CSS Level 2.1',))

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    @pytest.mark.xfail(reason="#37")
    def test_validateWithProfile_fonts(self, params, results):
        "Profiles.validateWithProfile()"
        # testing for valid values overwritten in a profile
        v, m, p = results
        expected = v, m, list(p)
>       assert cssutils.profile.validateWithProfile(*params) == expected
E       AssertionError: assert (False, False, []) == (True, False,...S Level 2.1'])
E
E         At index 0 diff: False != True
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:740: AssertionError
________ TestProfiles.test_validateWithProfile_fonts[params2-results2] _________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f763aeeb0>
params = (('CSS Fonts Module Level 3 @font-face properties',), 'font-stretch', ('normal', 'wider', 'narrower', 'inherit'))
results = (True, False, ('CSS Fonts Module Level 3',))

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    @pytest.mark.xfail(reason="#37")
    def test_validateWithProfile_fonts(self, params, results):
        "Profiles.validateWithProfile()"
        # testing for valid values overwritten in a profile
        v, m, p = results
        expected = v, m, list(p)
>       assert cssutils.profile.validateWithProfile(*params) == expected
E       AssertionError: assert (False, False, []) == (True, False,...ule Level 3'])
E
E         At index 0 diff: False != True
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:740: AssertionError
________ TestProfiles.test_validateWithProfile_fonts[params3-results3] _________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f763aea00>
params = (('CSS Fonts Module Level 3 @font-face properties',), 'font-style', ('inherit',))
results = (True, False, ('CSS Level 2.1',))

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    @pytest.mark.xfail(reason="#37")
    def test_validateWithProfile_fonts(self, params, results):
        "Profiles.validateWithProfile()"
        # testing for valid values overwritten in a profile
        v, m, p = results
        expected = v, m, list(p)
>       assert cssutils.profile.validateWithProfile(*params) == expected
E       AssertionError: assert (False, False, []) == (True, False,...S Level 2.1'])
E
E         At index 0 diff: False != True
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:740: AssertionError
________ TestProfiles.test_validateWithProfile_fonts[params4-results4] _________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7f1f763ae610>
params = (('CSS Fonts Module Level 3 @font-face properties',), 'font-weight', ('bolder', 'lighter', 'inherit'))
results = (True, False, ('CSS Level 2.1',))

    @pytest.mark.parametrize(('params', 'results'), _gen_validation_inputs())
    @pytest.mark.xfail(reason="#37")
    def test_validateWithProfile_fonts(self, params, results):
        "Profiles.validateWithProfile()"
        # testing for valid values overwritten in a profile
        v, m, p = results
        expected = v, m, list(p)
>       assert cssutils.profile.validateWithProfile(*params) == expected
E       AssertionError: assert (False, False, []) == (True, False,...S Level 2.1'])
E
E         At index 0 diff: False != True
E         Use -v to get more diff

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_profiles.py:740: AssertionError
______________________ TestCSSVariable.test_cssValueType _______________________

self = <cssutils.tests.test_value.TestCSSVariable object at 0x7f1f766a43d0>

    @pytest.mark.xfail(reason="not implemented")
    def test_cssValueType(self):
        "CSSValue.cssValueType .cssValueTypeString"
        tests = [
>           (['inherit', 'INhe\\rit'], 'CSS_INHERIT', cssutils.css.CSSValue),
            (
                [
                    '1',
                    '1%',
                    '1em',
                    '1ex',
                    '1px',
                    '1cm',
                    '1mm',
                    '1in',
                    '1pt',
                    '1pc',
                    '1deg',
                    '1rad',
                    '1grad',
                    '1ms',
                    '1s',
                    '1hz',
                    '1khz',
                    '1other',
                    '"string"',
                    "'string'",
                    'url(x)',
                    'red',
                    'attr(a)',
                    'counter(x)',
                    'rect(1px, 2px, 3px, 4px)',
                    'rgb(0, 0, 0)',
                    '#000',
                    '#123456',
                    'rgba(0, 0, 0, 0)',
                    'hsl(0, 0, 0)',
                    'hsla(0, 0, 0, 0)',
                ],
                'CSS_PRIMITIVE_VALUE',
                cssutils.css.CSSPrimitiveValue,
            ),
            (
                ['1px 1px', 'red blue green x'],
                'CSS_VALUE_LIST',
                cssutils.css.CSSValueList,
            ),
            # what is a custom value?
            # ([], 'CSS_CUSTOM', cssutils.css.CSSValue)
        ]
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:719: AttributeError
_______________________ TestCSSPrimitiveValue.test_init ________________________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f768a64c0>

    def test_init(self):
        "CSSPrimitiveValue.__init__()"
>       v = cssutils.css.CSSPrimitiveValue('1')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:781: AttributeError
____________________ TestCSSPrimitiveValue.test_CSS_UNKNOWN ____________________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f768a6460>

    def test_CSS_UNKNOWN(self):
        "CSSPrimitiveValue.CSS_UNKNOWN"
>       v = cssutils.css.CSSPrimitiveValue('expression(false)')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:804: AttributeError
__________ TestCSSPrimitiveValue.test_CSS_NUMBER_AND_OTHER_DIMENSIONS __________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f768a6250>

    def test_CSS_NUMBER_AND_OTHER_DIMENSIONS(self):
        "CSSPrimitiveValue.CSS_NUMBER .. CSS_DIMENSION"
        defs = [
            ('', 'CSS_NUMBER'),
            ('%', 'CSS_PERCENTAGE'),
            ('em', 'CSS_EMS'),
            ('ex', 'CSS_EXS'),
            ('px', 'CSS_PX'),
            ('cm', 'CSS_CM'),
            ('mm', 'CSS_MM'),
            ('in', 'CSS_IN'),
            ('pt', 'CSS_PT'),
            ('pc', 'CSS_PC'),
            ('deg', 'CSS_DEG'),
            ('rad', 'CSS_RAD'),
            ('grad', 'CSS_GRAD'),
            ('ms', 'CSS_MS'),
            ('s', 'CSS_S'),
            ('hz', 'CSS_HZ'),
            ('khz', 'CSS_KHZ'),
            ('other_dimension', 'CSS_DIMENSION'),
        ]
        for dim, name in defs:
            for n in (0, 1, 1.1, -1, -1.1, -0):
>               v = cssutils.css.CSSPrimitiveValue('%i%s' % (n, dim))
E               AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:832: AttributeError
_______________ TestCSSPrimitiveValue.test_CSS_STRING_AND_OTHER ________________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f768a6760>

    def test_CSS_STRING_AND_OTHER(self):
        "CSSPrimitiveValue.CSS_STRING .. CSS_RGBCOLOR"
        defs = [
            (
                (
                    '""',
                    "''",
                    '"some thing"',
                    "' A\\ND '",
                    # comma separated lists are STRINGS FOR NOW!
                    'a, b',
                    '"a", "b"',
                ),
                'CSS_STRING',
            ),
            (('url(a)', 'url("a b")', "url(' ')"), 'CSS_URI'),
            (('some', 'or_anth-er'), 'CSS_IDENT'),
            (('attr(a)', 'attr(b)'), 'CSS_ATTR'),
            (('counter(1)', 'counter(2)'), 'CSS_COUNTER'),
            (('rect(1,2,3,4)',), 'CSS_RECT'),
            (('rgb(1,2,3)', 'rgb(10%, 20%, 30%)', '#123', '#123456'), 'CSS_RGBCOLOR'),
            (
                (
                    'rgba(1,2,3,4)',
                    'rgba(10%, 20%, 30%, 40%)',
                ),
                'CSS_RGBACOLOR',
            ),
            (('U+0', 'u+ffffff', 'u+000000-f', 'u+0-f, U+ee-ff'), 'CSS_UNICODE_RANGE'),
        ]

        for examples, name in defs:
            for x in examples:
>               v = cssutils.css.CSSPrimitiveValue(x)
E               AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:869: AttributeError
_____________________ TestCSSPrimitiveValue.test_getFloat ______________________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f768a6970>

    def test_getFloat(self):
        "CSSPrimitiveValue.getFloatValue()"
        # NOT TESTED are float values as it seems difficult to
        # compare these. Maybe use decimal.Decimal?

>       v = cssutils.css.CSSPrimitiveValue('1px')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:878: AttributeError
_____________________ TestCSSPrimitiveValue.test_setFloat ______________________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f76a307c0>

    def test_setFloat(self):
        "CSSPrimitiveValue.setFloatValue()"
>       V = cssutils.css.CSSPrimitiveValue
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:922: AttributeError
_____________________ TestCSSPrimitiveValue.test_getString _____________________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f76a30670>

    def test_getString(self):
        "CSSPrimitiveValue.getStringValue()"
>       v = cssutils.css.CSSPrimitiveValue('1px')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:1072: AttributeError
_____________________ TestCSSPrimitiveValue.test_setString _____________________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f76a30df0>

    def test_setString(self):
        "CSSPrimitiveValue.setStringValue()"
        # CSS_STRING
>       v = cssutils.css.CSSPrimitiveValue('"a"')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:1100: AttributeError
___________________ TestCSSPrimitiveValue.test_typeRGBColor ____________________

self = <cssutils.tests.test_value.TestCSSPrimitiveValue object at 0x7f1f76a303d0>

    def test_typeRGBColor(self):
        "RGBColor"
>       v = cssutils.css.CSSPrimitiveValue('RGB(1, 5, 10)')
E       AttributeError: module 'cssutils.css' has no attribute 'CSSPrimitiveValue'

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_value.py:1236: AttributeError
_____________________________ TestX.test_priority ______________________________

self = <cssutils.tests.test_x.TestX object at 0x7f1f7625e8b0>

    @pytest.mark.xfail(reason="not implemented")
    def test_priority(self):
        "Property.priority"
        s = cssutils.parseString('a { color: red }')
        assert s.cssText == b'a {\n    color: red\n    }'

        assert '' == s.cssRules[0].style.getPropertyPriority('color')

        s = cssutils.parseString('a { color: red !important }')
>       assert 'a {\n    color: red !important\n    }' == s.cssText
E       AssertionError: assert 'a {\n    color: red !important\n    }' == b'a {\n    color: red !important\n    }'
E        +  where b'a {\n    color: red !important\n    }' = cssutils.css.CSSStyleSheet(href=None, media=None, title=None).cssText

/home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/cssutils/tests/test_x.py:20: AssertionError
=============================== warnings summary ===============================
cssutils/tests/test_encutils.py::TestAutoEncoding::test_getEncodingInfo
cssutils/tests/test_encutils.py::TestAutoEncoding::test_getEncodingInfo
  /home/tkloczko/rpmbuild/BUILD/cssutils-2.9.0/encutils/__init__.py:652: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
    log.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================== XPASSES ====================================
=========================== short test summary info ============================
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValue::test_init - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValue::test_escapes - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValue::test_cssText - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValue::test_cssText2 - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValue::test_cssValueType - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValue::test_readonly - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValue::test_reprANDstr - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_init - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_CSS_UNKNOWN - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_CSS_NUMBER_AND_OTHER_DIMENSIONS - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_CSS_STRING_AND_OTHER - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_getFloat - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_setFloat - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_getString - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_setString - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_typeRGBColor - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSPrimitiveValue::test_reprANDstr - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValueList::test_init - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValueList::test_numbers - incomplete
XFAIL cssutils/tests/test_cssvalue.py::TestCSSValueList::test_reprANDstr - incomplete
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params3-results3] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params4-results4] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params5-results5] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params6-results6] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params7-results7] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params8-results8] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params0-results0] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params1-results1] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params2-results2] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params3-results3] - #37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params4-results4] - #37
XFAIL cssutils/tests/test_value.py::TestCSSVariable::test_cssValueType - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_init - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_CSS_UNKNOWN - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_CSS_NUMBER_AND_OTHER_DIMENSIONS - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_CSS_STRING_AND_OTHER - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_getFloat - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_setFloat - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_getString - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_setString - not implemented
XFAIL cssutils/tests/test_value.py::TestCSSPrimitiveValue::test_typeRGBColor - not implemented
XFAIL cssutils/tests/test_x.py::TestX::test_priority - not implemented
XPASS cssutils/tests/test_cssvalue.py::TestCSSValue::test_incomplete - incomplete
FAILED cssutils/tests/test_domimplementation.py::TestDOMImplementation::test_createCSSStyleSheet
FAILED cssutils/tests/test_domimplementation.py::TestDOMImplementation::test_createDocument
FAILED cssutils/tests/test_domimplementation.py::TestDOMImplementation::test_createDocumentType
FAILED cssutils/tests/test_domimplementation.py::TestDOMImplementation::test_hasFeature
FAILED cssutils/tests/test_value.py::TestPropertyValue::test_cssText - Attrib...
======= 5 failed, 408 passed, 42 xfailed, 1 xpassed, 2 warnings in 6.28s =======
List of installed modules in build env:
Package                       Version
----------------------------- -----------
alabaster                     0.7.16
autocommand                   2.2.2
Babel                         2.14.0
build                         1.1.1
cffi                          1.16.0
charset-normalizer            3.3.2
cryptography                  42.0.5
cssselect                     1.2.0
distro                        1.9.0
dnf                           4.19.0
docutils                      0.20.1
domdf_python_tools            3.8.0.post2
exceptiongroup                1.1.3
gpg                           1.23.2
idna                          3.6
imagesize                     1.4.1
importlib_metadata            7.0.1
importlib_resources           6.3.1
iniconfig                     2.0.0
installer                     0.7.0
jaraco.classes                3.3.1
jaraco.context                4.3.0
jaraco.functools              4.0.0
jaraco.packaging              9.4.0
jaraco.test                   5.3.0
jaraco.tidelift               1.5.1
jeepney                       0.8.0
Jinja2                        3.1.3
keyring                       24.3.1
libdnf                        0.73.0
lxml                          5.1.0
MarkupSafe                    2.1.3
mock                          5.1.0
more-itertools                10.2.0
natsort                       8.3.1
packaging                     24.0
pluggy                        1.4.0
ply                           3.11
pycparser                     2.21
Pygments                      2.17.2
pyproject_hooks               1.0.0
pytest                        8.1.1
python-dateutil               2.9.0.post0
requests                      2.31.0
requests-toolbelt             1.0.0
rst.linker                    2.4.0
SecretStorage                 3.3.3
setuptools                    69.1.1
setuptools-scm                8.0.4
snowballstemmer               2.2.0
Sphinx                        7.2.6
sphinxcontrib-applehelp       1.0.8
sphinxcontrib-devhelp         1.0.5
sphinxcontrib-htmlhelp        2.0.5
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.7
sphinxcontrib-serializinghtml 1.1.10
tokenize_rt                   5.2.0
tomli                         2.0.1
typing_extensions             4.10.0
urllib3                       1.26.18
wheel                         0.43.0
zipp                          3.17.0

Please let me know if you need more details or want me to perform some diagnostics.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.