diff --git a/unittests/__init__.py b/unittests/__init__.py index d4035e3..d2b0bd2 100644 --- a/unittests/__init__.py +++ b/unittests/__init__.py @@ -9,7 +9,8 @@ import tempfile class ChirunCompilationTest(unittest.TestCase): - """ A unit test which compiles a Chirun package. + r""" + A unit test which compiles a Chirun package. The files in the ``source_path`` are copied to a temporary directory before being compiled. Run with the environment variable ``KEEP_TEST_OUTPUT=1`` to preserve the contents of the temporary directory, under ``unittests/_kept`` """ @@ -72,7 +73,7 @@ def tearDownClass(cls): cls.tmpdir.cleanup() def get_soup(self, path): - """ + r""" Get a BeautifulSoup instance for the given HTML file in the build directory. """ @@ -85,7 +86,8 @@ def get_manifest(self): return json.load(fp) class ExpectCrashTest(ChirunCompilationTest): - """ A test case which expects Chirun to quit with an error. + r""" + A test case which expects Chirun to quit with an error. """ show_stderr = False diff --git a/unittests/basic.py b/unittests/basic.py index b3e6489..14662e2 100644 --- a/unittests/basic.py +++ b/unittests/basic.py @@ -53,7 +53,8 @@ def test_structure(self): self.assertEqual([x['type'] for x in manifest['structure']], ['introduction', 'chapter', 'chapter'], msg="There is an introduction and two chapters.") def test_empty_links(self): - """ Check that all links on the introduction page contain readable text. + """ + Check that all links on the introduction page contain readable text. Tests https://github.com/chirun-ncl/chirun/issues/12 """ @@ -62,7 +63,8 @@ def test_empty_links(self): self.assertFalse(any(a.text == '' for a in intro.find_all('a')), msg='All links contain text') def test_file_build_time(self): - """ Check that URLs of static files have a ``build_time`` query parameter added, to prevent caching. + """ + Check that URLs of static files have a ``build_time`` query parameter added, to prevent caching. Tests https://github.com/chirun-ncl/chirun/issues/199 """ diff --git a/unittests/ifplastex.py b/unittests/ifplastex.py index 3a217a7..84c0243 100644 --- a/unittests/ifplastex.py +++ b/unittests/ifplastex.py @@ -6,7 +6,8 @@ class IfplastexTest(ChirunCompilationTest): compile_args = ['-f','test.tex'] def test_ifplastex(self): - """ Test that the ``\ifplastex`` and ``\ifpdflatex`` commands are defined and work as expected. + r""" + Test that the ``\ifplastex`` and ``\ifpdflatex`` commands are defined and work as expected. Tests https://github.com/chirun-ncl/chirun/issues/124 """ diff --git a/unittests/placeins.py b/unittests/placeins.py index cf525c0..613a272 100644 --- a/unittests/placeins.py +++ b/unittests/placeins.py @@ -5,7 +5,8 @@ class PlaceinsTest(ChirunCompilationTest): compile_args = ['-f','test.tex', '--no-pdf'] def test_floatbarrier(self): - """ The ``\FloatBarrier`` command shouldn't stop HTML output from working' + r""" + The ``\FloatBarrier`` command shouldn't stop HTML output from working' Tests https://github.com/chirun-ncl/chirun/issues/164 """ diff --git a/unittests/slash.py b/unittests/slash.py index c1b803e..22c8805 100644 --- a/unittests/slash.py +++ b/unittests/slash.py @@ -5,7 +5,8 @@ class SlashTest(ChirunCompilationTest): compile_args = ['-f', 'test.tex', '--no-pdf'] def test_slash(self): - """ Check that the ``\slash`` command is interpreted and produces a forward slash character. + r""" + Check that the ``\slash`` command is interpreted and produces a forward slash character. Tests https://github.com/chirun-ncl/chirun/issues/211 """ diff --git a/unittests/slides.py b/unittests/slides.py index 13ba980..a87d7d6 100644 --- a/unittests/slides.py +++ b/unittests/slides.py @@ -4,7 +4,8 @@ class SlidesTest(ChirunCompilationTest): source_path = 'slides' def test_beamer_slides_author(self): - """ Test that the author field for the slides item is used, instead of the package's author. + r""" + Test that the author field for the slides item is used, instead of the package's author. Tests https://github.com/chirun-ncl/chirun/issues/14 """ @@ -14,7 +15,8 @@ def test_beamer_slides_author(self): self.assertEqual(soup.select_one('#title-slide .author').text, 'A.N. Other') def test_beamer_slide_title(self): - """ Test that a frame with a given title has that title displayed in the HTML slides version. + r""" + Test that a frame with a given title has that title displayed in the HTML slides version. Tests https://github.com/chirun-ncl/chirun/issues/28 """ @@ -25,7 +27,8 @@ def test_beamer_slide_title(self): self.assertEqual(soup.select('.beamer-frame')[3].select_one('.beamer-frame-title').text, 'Title as param') def test_beamer_slides_tableofcontents(self): - """ Test that a table of contents is produced, with a link to each section. + r""" + Test that a table of contents is produced, with a link to each section. Tests https://github.com/chirun-ncl/chirun/issues/48 """ @@ -38,7 +41,8 @@ def test_beamer_slides_tableofcontents(self): self.assertEqual(contents_slide.select_one('a').text.strip(), 'Section') def test_beamer_loads_hyperref(self): - """ Test that the beamer documentclass loads the hyperref package. + r""" + Test that the beamer documentclass loads the hyperref package. Tests https://github.com/chirun-ncl/chirun/issues/103 """ @@ -51,7 +55,8 @@ def test_beamer_loads_hyperref(self): self.assertEqual(a.text, 'Example') def test_appendixnumberbeamer(self): - """ Test that the appendixnumberbeamer package loads. + r""" + Test that the appendixnumberbeamer package loads. Tests https://github.com/chirun-ncl/chirun/issues/40 """ @@ -59,7 +64,8 @@ def test_appendixnumberbeamer(self): self.assertTrue((self.build_dir / 'appendix_number' / 'index.html').exists()) def test_pause(self): - """ The \pause command is removed from any math expressions. + r""" + The \pause command is removed from any math expressions. Tests https://github.com/chirun-ncl/chirun/issues/58 """ diff --git a/unittests/verbatim.py b/unittests/verbatim.py index fd04488..2e0a473 100644 --- a/unittests/verbatim.py +++ b/unittests/verbatim.py @@ -5,7 +5,8 @@ class VerbatimTest(ChirunCompilationTest): compile_args = ['-f', 'test.tex', '--no-pdf'] def test_comment_environment(self): - """ Check that you can define a new environment which wraps a \comment command. + r""" + Check that you can define a new environment which wraps a \comment command. Tests https://github.com/chirun-ncl/chirun/issues/87 """