we don't package tinycss (and it's *very* deprecated), so it's easier to just skip these tests diff --git a/setup.py b/setup.py index 0f63a21..b713398 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ install_requires = \ ['sphinx >= 1.8'] extras_require = \ -{'test': ['html5lib', 'tinycss']} +{'test': ['html5lib']} entry_points = \ {'sphinx.html_themes': ['quark = quark_sphinx_theme']} diff --git a/test/test_theme.py b/test/test_theme.py index aa9543d..6910aae 100644 --- a/test/test_theme.py +++ b/test/test_theme.py @@ -23,9 +23,6 @@ class TestThemeEntrypoint(SphinxBuildFixture, unittest.TestCase): class TestThemeDefaults(SphinxBuildFixture, unittest.TestCase): source_dir = testdoc_theme - def test_quark_css(self): - self.assertSphinxCSSValid('quark.css') - def _nav_elems(self, doc): self.assertHasElement(doc, './/table[@class="nav-sidebar"]') self.assertHasElement(doc, './/table[@class="navbar navbar-top"]') @@ -63,9 +60,6 @@ class TestThemeExtraCss(SphinxBuildFixture, unittest.TestCase): '_static/extra2.css' } - def test_quark_css(self): - self.assertSphinxCSSValid('quark.css') - @with_document('contents') def test_contents_css_files(self, doc): extra_css = { @@ -83,9 +77,6 @@ class TestThemeNoSidebar(SphinxBuildFixture, unittest.TestCase): 'html_theme_options.nosidebar': True, } - def test_quark_css(self): - self.assertSphinxCSSValid('quark.css') - def _nav_elems(self, doc): self.assertNotElement(doc, './/table[@class="nav-sidebar"]') self.assertHasElement(doc, './/table[@class="navbar navbar-top"]') @@ -151,9 +142,6 @@ class TestThemeAllSettingsUnset(SphinxBuildFixture, unittest.TestCase): ] config = {'html_theme_options.%s' % s: '' for s in _SETTINGS} - def test_quark_css(self): - self.assertSphinxCSSValid('quark.css') - if __name__ == '__main__': unittest.main() diff --git a/test/util.py b/test/util.py index 86b3d43..b59d474 100644 --- a/test/util.py +++ b/test/util.py @@ -6,7 +6,6 @@ import sys import tempfile import html5lib -import tinycss from sphinx.cmd.build import main @@ -31,24 +30,6 @@ def capture_output(): yield stdout -def get_css_errors(filename_or_fobj, encoding=None): - if hasattr(filename_or_fobj, 'read'): - source = filename_or_fobj.read() - else: - with open(filename_or_fobj, 'r', encoding=encoding) as fobj: - source = fobj.read() - parser = tinycss.make_parser() - css = parser.parse_stylesheet(source) - lines = source.split('\n') - errors = [] - for err in css.errors: - try: - errors.append(' %s [%s]\n' % (err, lines[err.line - 1])) - except IndexError: - errors.append(' %s\n' % err) - return errors - - def run_sphinx(source_dir, build_dir, builder='html', extra_config={}, tags=[]): args = ['-b', builder, '-N'] for k, v in extra_config.items(): @@ -104,14 +85,6 @@ class SphinxBuildFixture: def assertNotElement(self, doc, path): self.assertHasElement(doc, path, 0) - def assertCSSValid(self, filename_or_fobj, encoding=None): - errors = get_css_errors(filename_or_fobj, encoding) - self.assertEqual(len(errors), 0, 'CSS errors:\n' + ''.join(errors)) - - def assertSphinxCSSValid(self, basename, encoding='utf-8'): - self.assertCSSValid(os.path.join(self.build_dir, '_static', basename), - encoding=encoding) - def with_document(docname): def wrap1(func):