Skip to content

test_case

[ allennlp.common.testing.test_case ]


TEST_DIR#

TEST_DIR = tempfile.mkdtemp(prefix="allennlp_tests")

AllenNlpTestCase Objects#

class AllenNlpTestCase()

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

PROJECT_ROOT#

PROJECT_ROOT = (pathlib.Path(__file__).parent / ".." / ".." / "..").resolve()

MODULE_ROOT#

MODULE_ROOT = PROJECT_ROOT / "allennlp"

TOOLS_ROOT#

TOOLS_ROOT = MODULE_ROOT / "tools"

TESTS_ROOT#

TESTS_ROOT = PROJECT_ROOT / "tests"

FIXTURES_ROOT#

FIXTURES_ROOT = PROJECT_ROOT / "test_fixtures"

setup_method#

 | def setup_method(self)

teardown_method#

 | def teardown_method(self)