Skip to content

test_case

allennlp.common.testing.test_case

[SOURCE]


TEST_DIR

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

AllenNlpTestCase

class AllenNlpTestCase

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 AllenNlpTestCase:
 | ...
 | PROJECT_ROOT = (pathlib.Path(__file__).parent / ".." / ".." / "..").resolve()

MODULE_ROOT

class AllenNlpTestCase:
 | ...
 | MODULE_ROOT = PROJECT_ROOT / "allennlp"

TOOLS_ROOT

class AllenNlpTestCase:
 | ...
 | TOOLS_ROOT = MODULE_ROOT / "tools"

PROJECT_ROOT_FALLBACK

class AllenNlpTestCase:
 | ...
 | PROJECT_ROOT_FALLBACK = (
        # users wanting to run test suite for installed package
        pathlib.Path(os.environ["A ...

TESTS_ROOT

class AllenNlpTestCase:
 | ...
 | TESTS_ROOT = PROJECT_ROOT_FALLBACK / "tests"

FIXTURES_ROOT

class AllenNlpTestCase:
 | ...
 | FIXTURES_ROOT = PROJECT_ROOT_FALLBACK / "test_fixtures"

setup_method

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

teardown_method

class AllenNlpTestCase:
 | ...
 | def teardown_method(self)