From 3a2bb2d348f5517a3e4eda52b03d563023f72d78 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 8 Oct 2015 18:04:53 +0200 Subject: [PATCH] Add cssutils to README and utils/version.py --- README.asciidoc | 3 +++ qutebrowser/utils/version.py | 1 + tests/unit/utils/test_version.py | 14 ++++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index 43240d97c..04ca13a35 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -100,6 +100,9 @@ The following software and libraries are required to run qutebrowser: * http://pygments.org/[pygments] * http://pyyaml.org/wiki/PyYAML[PyYAML] +The following libraries are optional and provide a better user experience: +* http://cthedot.de/cssutils/[cssutils] + To generate the documentation for the `:help` command, when using the git repository (rather than a release), http://asciidoc.org/[asciidoc] is needed. diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 6975ba5fa..91366bd28 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -133,6 +133,7 @@ def _module_versions(): ('jinja2', ['__version__']), ('pygments', ['__version__']), ('yaml', ['__version__']), + ('cssutils', ['__version__']), ]) for name, attributes in modules.items(): try: diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index 8502c6878..d759b44dd 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -324,6 +324,7 @@ class ImportFake: 'jinja2': True, 'pygments': True, 'yaml': True, + 'cssutils': True, } self.version_attribute = '__version__' self.version = '1.2.3' @@ -383,12 +384,13 @@ class TestModuleVersions: """Test with all modules present in version 1.2.3.""" expected = ['sip: yes', 'colorlog: yes', 'colorama: 1.2.3', 'pypeg2: 1.2.3', 'jinja2: 1.2.3', 'pygments: 1.2.3', - 'yaml: 1.2.3'] + 'yaml: 1.2.3', 'cssutils: 1.2.3'] assert version._module_versions() == expected @pytest.mark.parametrize('module, idx, expected', [ ('colorlog', 1, 'colorlog: no'), ('colorama', 2, 'colorama: no'), + ('cssutils', 7, 'cssutils: no'), ]) def test_missing_module(self, module, idx, expected, import_fake): """Test with a module missing. @@ -404,12 +406,13 @@ class TestModuleVersions: @pytest.mark.parametrize('value, expected', [ ('VERSION', ['sip: yes', 'colorlog: yes', 'colorama: 1.2.3', 'pypeg2: yes', 'jinja2: yes', 'pygments: yes', - 'yaml: yes']), + 'yaml: yes', 'cssutils: yes']), ('SIP_VERSION_STR', ['sip: 1.2.3', 'colorlog: yes', 'colorama: yes', 'pypeg2: yes', 'jinja2: yes', 'pygments: yes', - 'yaml: yes']), + 'yaml: yes', 'cssutils: yes']), (None, ['sip: yes', 'colorlog: yes', 'colorama: yes', 'pypeg2: yes', - 'jinja2: yes', 'pygments: yes', 'yaml: yes']), + 'jinja2: yes', 'pygments: yes', 'yaml: yes', + 'cssutils: yes']), ]) def test_version_attribute(self, value, expected, import_fake): """Test with a different version attribute. @@ -432,6 +435,9 @@ class TestModuleVersions: ('jinja2', True), ('pygments', True), ('yaml', True), + pytest.mark.xfail(sys.version_info >= (3, 5), reason='cssutils 1.0 and' + ' earlier are broken on Python 3.5')(('cssutils', + True)), ]) def test_existing_attributes(self, name, has_version): """Check if all dependencies have an expected __version__ attribute.