Skip to content

test_case

allennlp_hydra.utils.testing.test_case

[SOURCE]


PROJECT_ROOT#

PROJECT_ROOT = pathlib.Path(__file__).parents[3].resolve()

TEST_ROOT#

TEST_ROOT = PROJECT_ROOT.joinpath("tests")

FIXTURES_ROOT#

FIXTURES_ROOT = PROJECT_ROOT.joinpath("test_fixtures")

BaseTestCase#

class BaseTestCase

A custom testing class that disables some of the more verbose AllenNLP logging and that creates and destroys a temp directory as a test fixture.

PROJECT_ROOT#

class BaseTestCase:
 | ...
 | PROJECT_ROOT = PROJECT_ROOT

MODULE_ROOT#

class BaseTestCase:
 | ...
 | MODULE_ROOT = PROJECT_ROOT / "src"

TESTS_ROOT#

class BaseTestCase:
 | ...
 | TESTS_ROOT = TEST_ROOT

FIXTURES_ROOT#

class BaseTestCase:
 | ...
 | FIXTURES_ROOT = FIXTURES_ROOT

FIXTURES_DATA_PATH#

class BaseTestCase:
 | ...
 | FIXTURES_DATA_PATH = FIXTURES_ROOT / "data"

test_dir#

class BaseTestCase:
 | ...
 | @pytest.fixture(autouse=True)
 | def test_dir(self, tmpdir)

setup_method#

class BaseTestCase:
 | ...
 | def setup_method(self)