Skip to content

Commit

Permalink
Remove uses of unittest.TestCase (#68)
Browse files Browse the repository at this point in the history
They don't play well with pytest.mark.parametrize for instance.
  • Loading branch information
hoodmane authored Sep 25, 2023
1 parent 3a5b154 commit aa3a360
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tests/test_build_ts/test_build_ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tests.testing import SphinxBuildTestCase


class TextBuilderTests(SphinxBuildTestCase):
class TestTextBuilder(SphinxBuildTestCase):
"""Tests which require our big TS Sphinx tree to be built (as text)"""

def test_autoclass_constructor(self):
Expand Down Expand Up @@ -152,7 +152,7 @@ def test_async(self):
)


class HtmlBuilderTests(SphinxBuildTestCase):
class TestHtmlBuilder(SphinxBuildTestCase):
"""Tests which require an HTML build of our Sphinx tree, for checking
links"""

Expand Down
4 changes: 2 additions & 2 deletions tests/test_jsdoc_analysis/test_jsdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_doclet_full_path():
]


class FunctionTests(JsDocTestCase):
class TestFunction(JsDocTestCase):
file = "function.js"

def test_top_level_and_function(self):
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_top_level_and_function(self):
)


class ClassTests(JsDocTestCase):
class TestClass(JsDocTestCase):
file = "class.js"

def test_class(self):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_typedoc_analysis/test_typedoc_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def join_descri(t: Type) -> str:
return "".join(e.name if isinstance(e, TypeXRef) else e for e in t)


class PopulateIndexTests(TestCase):
class TestPopulateIndex(TestCase):
def test_top_level_function(self):
"""Make sure nodes get indexed."""
# A simple TypeDoc JSON dump of a source file with a single, top-level
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_top_level_function(self):
assert root.name == "misterRoot"


class PathSegmentsTests(TypeDocTestCase):
class TestPathSegments(TypeDocTestCase):
"""Make sure ``make_path_segments() `` works on all its manifold cases."""

files = ["pathSegments.ts"]
Expand Down Expand Up @@ -256,7 +256,7 @@ def test_namespaced_var(self):
]


class ConvertNodeTests(TypeDocAnalyzerTestCase):
class TestConvertNode(TypeDocAnalyzerTestCase):
"""Test all the branches of ``convert_node()`` by analyzing every kind of
TypeDoc JSON object."""

Expand Down Expand Up @@ -414,7 +414,7 @@ def test_setter(self):
assert setter.type == ["string"]


class TypeNameTests(TypeDocAnalyzerTestCase):
class TestTypeName(TypeDocAnalyzerTestCase):
"""Make sure our rendering of TypeScript types into text works."""

files = ["types.ts"]
Expand Down
3 changes: 1 addition & 2 deletions tests/testing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
from os.path import dirname, join
from shutil import rmtree
from unittest import TestCase

from pydantic import BaseModel
from sphinx.cmd.build import main as sphinx_main
Expand All @@ -12,7 +11,7 @@
from sphinx_js.typedoc import Converter, typedoc_output


class ThisDirTestCase(TestCase):
class ThisDirTestCase:
"""A TestCase that knows how to find the directory the subclass is defined
in"""

Expand Down

0 comments on commit aa3a360

Please sign in to comment.