Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests failing when resources unavailable after building from Github tarball #127

Open
kloczek opened this issue May 25, 2024 · 1 comment

Comments

@kloczek
Copy link

kloczek commented May 25, 2024

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.11.0-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.2.1, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/cssutils-2.11.0
configfile: pytest.ini
plugins: typeguard-4.2.1, jaraco.test-5.4.0
collected 457 items / 2 deselected / 455 selected

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 FFF.....                                                                                                                                              [ 40%]
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 ....                                                                                                                                         [ 49%]
cssutils/tests/test_encutils.py .......                                                                                                                                               [ 51%]
cssutils/tests/test_errorhandler.py ...                                                                                                                                               [ 52%]
cssutils/tests/test_helper.py .....                                                                                                                                                   [ 53%]
cssutils/tests/test_marginrule.py ........                                                                                                                                            [ 54%]
cssutils/tests/test_medialist.py .........                                                                                                                                            [ 56%]
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 F.                                                                                                                                          [ 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 .....................xxxxxxxxxx                                                                                                                          [ 98%]
cssutils/tests/test_x.py x                                                                                                                                                            [ 98%]
encutils/__init__.py .                                                                                                                                                                [ 98%]
examples/website.py ......                                                                                                                                                            [100%]

========================================================================================= FAILURES ==========================================================================================
_______________________________________________________________________________ TestCSSutils.test_parseString _______________________________________________________________________________

self = <cssutils.tests.test_cssutils.TestCSSutils object at 0x7efe6fc2ee90>

    def test_parseString(self):
        "cssutils.parseString()"
        s = cssutils.parseString(
            self.exp, media='handheld, screen', title='from string'
        )
        assert isinstance(s, cssutils.css.CSSStyleSheet)
        assert s.href is None
        assert self.exp.encode() == s.cssText
        assert 'utf-8' == s.encoding
        assert 'handheld, screen' == s.media.mediaText
        assert 'from string' == s.title
        assert self.exp.encode() == s.cssText

        ir = s.cssRules[0]
        assert 'import/import2.css' == ir.href
        irs = ir.styleSheet
        assert isinstance(irs, cssutils.css.CSSStyleSheet)

        href = basetest.get_sheet_filename('import.css')
        href = cssutils.helper.path2url(href)
        s = cssutils.parseString(self.exp, href=href)
        assert href == s.href

        ir = s.cssRules[0]
        assert 'import/import2.css' == ir.href
        irs = ir.styleSheet
        assert isinstance(irs, cssutils.css.CSSStyleSheet)
        assert (
>           irs.cssText == b'@import "../import3.css";\n'
            b'@import "import-impossible.css" print;\n.import2 {\n'
            b'    /* sheets/import2.css */\n'
            b'    background: url(http://example.com/images/example.gif);\n'
            b'    background: url(//example.com/images/example.gif);\n'
            b'    background: url(/images/example.gif);\n'
            b'    background: url(images2/example.gif);\n'
            b'    background: url(./images2/example.gif);\n'
            b'    background: url(../images/example.gif);\n'
            b'    background: url(./../images/example.gif)\n'
            b'    }'
        )
E       AssertionError

cssutils/tests/test_cssutils.py:56: AssertionError
________________________________________________________________________________ TestCSSutils.test_parseFile ________________________________________________________________________________

self = <cssutils.tests.test_cssutils.TestCSSutils object at 0x7efe6fc2c3d0>, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7efe6f738970>

    def test_parseFile(self, monkeypatch):
        "cssutils.parseFile()"
        # name if used with open, href used for @import resolving
        name = basetest.get_sheet_filename('import.css')
        href = cssutils.helper.path2url(name)

>       s = cssutils.parseFile(name, href=href, media='screen', title='from file')

cssutils/tests/test_cssutils.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/__init__.py:166: in func
    return getattr(CSSParser(), name)(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <cssutils.parse.CSSParser object at 0x7efe6f73ada0>
filename = PosixPath('/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/import.css'), encoding = None
href = 'file:/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/import.css', media = 'screen', title = 'from file'
validate = None

    def parseFile(
        self, filename, encoding=None, href=None, media=None, title=None, validate=None
    ):
        """Retrieve content from `filename` and parse it. Errors may be raised
        (e.g. IOError).

        :param filename:
            of the CSS file to parse, if no `href` is given filename is
            converted to a (file:) URL and set as ``href`` of resulting
            stylesheet.
            If `href` is given it is set as ``sheet.href``. Either way
            ``sheet.href`` is used to resolve e.g. stylesheet imports via
            @import rules.
        :param encoding:
            Value ``None`` defaults to encoding detection via BOM or an
            @charset rule.
            Other values override detected encoding for the sheet at
            `filename` including any imported sheets.
        :returns:
            :class:`~cssutils.css.CSSStyleSheet`.
        """
        if not href:
            # prepend // for file URL, urllib does not do this?
            # href = u'file:' + urllib.pathname2url(os.path.abspath(filename))
            href = path2url(filename)

>       with open(filename, 'rb') as fd:
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/import.css'

../../BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/parse.py:182: FileNotFoundError
________________________________________________________________________________ TestCSSutils.test_parseUrl _________________________________________________________________________________

self = <urllib.request.FileHandler object at 0x7efe6f72d7e0>, req = <urllib.request.Request object at 0x7efe6fea13c0>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
>           stats = os.stat(localfile)
E           FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/import.css'

/usr/lib64/python3.10/urllib/request.py:1505: FileNotFoundError

During handling of the above exception, another exception occurred:

self = <cssutils.tests.test_cssutils.TestCSSutils object at 0x7efe6fc2fcd0>

    def test_parseUrl(self):
        "cssutils.parseUrl()"
        href = basetest.get_sheet_filename('import.css')
        # href = u'file:' + urllib.pathname2url(href)
        href = cssutils.helper.path2url(href)
        # href = 'http://seewhatever.de/sheets/import.css'
>       s = cssutils.parseUrl(href, media='tv, print', title='from url')

cssutils/tests/test_cssutils.py:199:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/__init__.py:166: in func
    return getattr(CSSParser(), name)(*args, **kwargs)
../../BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/parse.py:209: in parseUrl
    encoding, enctype, text = cssutils.util._readUrl(
../../BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/util.py:928: in _readUrl
    r = fetcher(url)
../../BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/_fetch.py:45: in _defaultFetcher
    log.warn('URLError, %s' % e.reason, error=e)
../../BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/_fetch.py:39: in _defaultFetcher
    res = urllib.request.urlopen(request)
/usr/lib64/python3.10/urllib/request.py:216: in urlopen
    return opener.open(url, data, timeout)
/usr/lib64/python3.10/urllib/request.py:519: in open
    response = self._open(req, data)
/usr/lib64/python3.10/urllib/request.py:536: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib64/python3.10/urllib/request.py:496: in _call_chain
    result = func(*args)
/usr/lib64/python3.10/urllib/request.py:1483: in file_open
    return self.open_local_file(req)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.FileHandler object at 0x7efe6f72d7e0>, req = <urllib.request.Request object at 0x7efe6fea13c0>

    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
>           raise URLError(exp)
E           urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/import.css'>

/usr/lib64/python3.10/urllib/request.py:1522: URLError
________________________________________________________________________________ TestCSSCombine.test_combine ________________________________________________________________________________

self = <cssutils.tests.test_scripts_csscombine.TestCSSCombine object at 0x7efe6f7ef9a0>

    def test_combine(self):
        "scripts.csscombine()"

        # path, SHOULD be keyword argument!
        csspath = basetest.get_sheet_filename('csscombine-proxy.css')
>       combined = csscombine(csspath)

cssutils/tests/test_scripts_csscombine.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cssutils/script.py:353: in csscombine
    src = parser.parseFile(path, encoding=sourceencoding)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <cssutils.parse.CSSParser object at 0x7efe6f3c5720>
filename = PosixPath('/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/csscombine-proxy.css'), encoding = None
href = 'file:/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/csscombine-proxy.css', media = None, title = None
validate = None

    def parseFile(
        self, filename, encoding=None, href=None, media=None, title=None, validate=None
    ):
        """Retrieve content from `filename` and parse it. Errors may be raised
        (e.g. IOError).

        :param filename:
            of the CSS file to parse, if no `href` is given filename is
            converted to a (file:) URL and set as ``href`` of resulting
            stylesheet.
            If `href` is given it is set as ``sheet.href``. Either way
            ``sheet.href`` is used to resolve e.g. stylesheet imports via
            @import rules.
        :param encoding:
            Value ``None`` defaults to encoding detection via BOM or an
            @charset rule.
            Other values override detected encoding for the sheet at
            `filename` including any imported sheets.
        :returns:
            :class:`~cssutils.css.CSSStyleSheet`.
        """
        if not href:
            # prepend // for file URL, urllib does not do this?
            # href = u'file:' + urllib.pathname2url(os.path.abspath(filename))
            href = path2url(filename)

>       with open(filename, 'rb') as fd:
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/csscombine-proxy.css'

../../BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/parse.py:182: FileNotFoundError
========================================================================================= XFAILURES =========================================================================================
__________________________________________________________________________________ TestCSSValue.test_init ___________________________________________________________________________________

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

    def setup_method(self):
>       self.r = cssutils.css.CSSValue()  # needed for tests
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:16: AttributeError
_________________________________________________________________________________ TestCSSValue.test_escapes _________________________________________________________________________________

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

    def setup_method(self):
>       self.r = cssutils.css.CSSValue()  # needed for tests
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:16: AttributeError
_________________________________________________________________________________ TestCSSValue.test_cssText _________________________________________________________________________________

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

    def setup_method(self):
>       self.r = cssutils.css.CSSValue()  # needed for tests
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:16: AttributeError
________________________________________________________________________________ TestCSSValue.test_cssText2 _________________________________________________________________________________

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

    def setup_method(self):
>       self.r = cssutils.css.CSSValue()  # needed for tests
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:16: AttributeError
_______________________________________________________________________________ TestCSSValue.test_incomplete ________________________________________________________________________________

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

    def setup_method(self):
>       self.r = cssutils.css.CSSValue()  # needed for tests
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:16: AttributeError
______________________________________________________________________________ TestCSSValue.test_cssValueType _______________________________________________________________________________

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

    def setup_method(self):
>       self.r = cssutils.css.CSSValue()  # needed for tests
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:16: AttributeError
________________________________________________________________________________ TestCSSValue.test_readonly _________________________________________________________________________________

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

    def setup_method(self):
>       self.r = cssutils.css.CSSValue()  # needed for tests
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:16: AttributeError
_______________________________________________________________________________ TestCSSValue.test_reprANDstr ________________________________________________________________________________

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

    def setup_method(self):
>       self.r = cssutils.css.CSSValue()  # needed for tests
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:16: AttributeError
______________________________________________________________________________ TestCSSPrimitiveValue.test_init ______________________________________________________________________________

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

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

cssutils/tests/test_cssvalue.py:364: AttributeError
__________________________________________________________________________ TestCSSPrimitiveValue.test_CSS_UNKNOWN ___________________________________________________________________________

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

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

cssutils/tests/test_cssvalue.py:387: AttributeError
________________________________________________________________ TestCSSPrimitiveValue.test_CSS_NUMBER_AND_OTHER_DIMENSIONS _________________________________________________________________

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

    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'

cssutils/tests/test_cssvalue.py:415: AttributeError
______________________________________________________________________ TestCSSPrimitiveValue.test_CSS_STRING_AND_OTHER ______________________________________________________________________

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

    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'

cssutils/tests/test_cssvalue.py:452: AttributeError
____________________________________________________________________________ TestCSSPrimitiveValue.test_getFloat ____________________________________________________________________________

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

    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'

cssutils/tests/test_cssvalue.py:461: AttributeError
____________________________________________________________________________ TestCSSPrimitiveValue.test_setFloat ____________________________________________________________________________

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

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

cssutils/tests/test_cssvalue.py:505: AttributeError
___________________________________________________________________________ TestCSSPrimitiveValue.test_getString ____________________________________________________________________________

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

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

cssutils/tests/test_cssvalue.py:656: AttributeError
___________________________________________________________________________ TestCSSPrimitiveValue.test_setString ____________________________________________________________________________

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

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

cssutils/tests/test_cssvalue.py:684: AttributeError
__________________________________________________________________________ TestCSSPrimitiveValue.test_typeRGBColor __________________________________________________________________________

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

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

cssutils/tests/test_cssvalue.py:820: AttributeError
___________________________________________________________________________ TestCSSPrimitiveValue.test_reprANDstr ___________________________________________________________________________

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

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

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

cssutils/tests/test_cssvalue.py:843: AttributeError
________________________________________________________________________________ TestCSSValueList.test_init _________________________________________________________________________________

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

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

cssutils/tests/test_cssvalue.py:856: AttributeError
_______________________________________________________________________________ TestCSSValueList.test_numbers _______________________________________________________________________________

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

    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'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:893: AttributeError
_____________________________________________________________________________ TestCSSValueList.test_reprANDstr ______________________________________________________________________________

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

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

>       s = cssutils.css.CSSValue(v)
E       AttributeError: module 'cssutils.css' has no attribute 'CSSValue'. Did you mean: 'MSValue'?

cssutils/tests/test_cssvalue.py:902: AttributeError
__________________________________________________________________ TestProfiles.test_validateWithProfile[params3-results3] __________________________________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f8909d0>, 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

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

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f9dc820>, 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

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

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f9dc760>, 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

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

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f9dd7e0>, 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

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

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f9dce80>, 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

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

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f844eb0>, 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

cssutils/tests/test_profiles.py:232: AssertionError
_______________________________________________________________ TestProfiles.test_validateWithProfile_fonts[params0-results0] _______________________________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f845ed0>, 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

cssutils/tests/test_profiles.py:740: AssertionError
_______________________________________________________________ TestProfiles.test_validateWithProfile_fonts[params1-results1] _______________________________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f845ff0>, 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

cssutils/tests/test_profiles.py:740: AssertionError
_______________________________________________________________ TestProfiles.test_validateWithProfile_fonts[params2-results2] _______________________________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f846290>
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

cssutils/tests/test_profiles.py:740: AssertionError
_______________________________________________________________ TestProfiles.test_validateWithProfile_fonts[params3-results3] _______________________________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f846350>, 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

cssutils/tests/test_profiles.py:740: AssertionError
_______________________________________________________________ TestProfiles.test_validateWithProfile_fonts[params4-results4] _______________________________________________________________

self = <cssutils.tests.test_profiles.TestProfiles object at 0x7efe6f846410>, 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

cssutils/tests/test_profiles.py:740: AssertionError
_____________________________________________________________________________ TestCSSVariable.test_cssValueType _____________________________________________________________________________

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

    @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'. Did you mean: 'MSValue'?

cssutils/tests/test_value.py:724: AttributeError
______________________________________________________________________________ TestCSSPrimitiveValue.test_init ______________________________________________________________________________

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

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

cssutils/tests/test_value.py:786: AttributeError
__________________________________________________________________________ TestCSSPrimitiveValue.test_CSS_UNKNOWN ___________________________________________________________________________

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

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

cssutils/tests/test_value.py:809: AttributeError
________________________________________________________________ TestCSSPrimitiveValue.test_CSS_NUMBER_AND_OTHER_DIMENSIONS _________________________________________________________________

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

    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'

cssutils/tests/test_value.py:837: AttributeError
______________________________________________________________________ TestCSSPrimitiveValue.test_CSS_STRING_AND_OTHER ______________________________________________________________________

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

    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'

cssutils/tests/test_value.py:874: AttributeError
____________________________________________________________________________ TestCSSPrimitiveValue.test_getFloat ____________________________________________________________________________

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

    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'

cssutils/tests/test_value.py:883: AttributeError
____________________________________________________________________________ TestCSSPrimitiveValue.test_setFloat ____________________________________________________________________________

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

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

cssutils/tests/test_value.py:927: AttributeError
___________________________________________________________________________ TestCSSPrimitiveValue.test_getString ____________________________________________________________________________

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

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

cssutils/tests/test_value.py:1077: AttributeError
___________________________________________________________________________ TestCSSPrimitiveValue.test_setString ____________________________________________________________________________

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

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

cssutils/tests/test_value.py:1105: AttributeError
__________________________________________________________________________ TestCSSPrimitiveValue.test_typeRGBColor __________________________________________________________________________

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

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

cssutils/tests/test_value.py:1241: AttributeError
____________________________________________________________________________________ TestX.test_priority ____________________________________________________________________________________

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

    @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

cssutils/tests/test_x.py:20: AssertionError
================================================================================== 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_incomplete - 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] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params4-results4] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params5-results5] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params6-results6] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params7-results7] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile[params8-results8] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params0-results0] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params1-results1] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params2-results2] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params3-results3] - jaraco/cssutils#37
XFAIL cssutils/tests/test_profiles.py::TestProfiles::test_validateWithProfile_fonts[params4-results4] - jaraco/cssutils#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
FAILED cssutils/tests/test_cssutils.py::TestCSSutils::test_parseString - AssertionError
FAILED cssutils/tests/test_cssutils.py::TestCSSutils::test_parseFile - FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/i...
FAILED cssutils/tests/test_cssutils.py::TestCSSutils::test_parseUrl - urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssu...
FAILED cssutils/tests/test_scripts_csscombine.py::TestCSSCombine::test_combine - FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILDROOT/python-cssutils-2.11.0-2.fc37.x86_64/usr/lib/python3.10/site-packages/cssutils/tests/sheets/c...
================================================================== 4 failed, 408 passed, 2 deselected, 43 xfailed in 5.23s ==================================================================
List of installed modules in build env:
Package                       Version
----------------------------- -----------
alabaster                     0.7.16
autocommand                   2.2.2
Babel                         2.15.0
build                         1.2.1
cffi                          1.16.0
charset-normalizer            3.3.2
cryptography                  42.0.7
cssselect                     1.2.0
defusedxml                    0.7.1
docutils                      0.20.1
domdf_python_tools            3.8.0.post2
exceptiongroup                1.1.3
idna                          3.7
imagesize                     1.4.1
importlib_metadata            7.1.0
inflect                       7.2.1
iniconfig                     2.0.0
installer                     0.7.0
jaraco.classes                3.4.0
jaraco.collections            5.0.1
jaraco.context                4.3.0
jaraco.functools              4.0.1
jaraco.packaging              10.1.0
jaraco.test                   5.4.0
jaraco.text                   3.12.0
jaraco.tidelift               1.5.1
jeepney                       0.8.0
Jinja2                        3.1.4
keyring                       25.2.1
lxml                          5.2.2
MarkupSafe                    2.1.5
more-itertools                10.2.0
natsort                       8.4.0
packaging                     24.0
pluggy                        1.5.0
ply                           3.11
pycparser                     2.22
Pygments                      2.18.0
pyproject_hooks               1.0.0
pytest                        8.2.1
python-dateutil               2.9.0.post0
requests                      2.32.2
requests-toolbelt             1.0.0
rst.linker                    2.5.0
SecretStorage                 3.3.3
setuptools                    69.4.0
setuptools-scm                8.1.0
snowballstemmer               2.2.0
Sphinx                        7.3.7
sphinxcontrib-applehelp       1.0.8
sphinxcontrib-devhelp         1.0.6
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
typeguard                     4.2.1
typing_extensions             4.12.0
urllib3                       2.2.1
wheel                         0.43.0
zipp                          3.18.2

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

@jaraco
Copy link
Owner

jaraco commented Jun 1, 2024

Since this issue is more general than just for jaraco/cssutils, I've moved it to jaraco/skeleton.

I believe the issue you're encountering here is you're not getting the package data (like cssutils/tests/sheets/csscombine-proxy.css). It's the same issue as jaraco/pytest-enabler#9 and jaraco/jaraco.text#5 (comment). These projects depend on setuptools_scm to infer from the git repository which files should be included in the sdist. Since you're not building from an sdist or the git repo, you'll be responsible to supply the metadata to ensure package data is included.

In the case of jaraco.text you manually copy the file. In the case of pytest-enabler, I suggested adding a MANIFEST.in that just includes everything.

Do either of those approaches work to solve this issue in general?

@jaraco jaraco changed the title 2.11.0: pytest fails in 4 units tests failing when resources unavailable after building from Github tarball Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants