allennlp.common.testing.test_case#

AllenNlpTestCase#

AllenNlpTestCase(self, methodName='runTest')

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.

FIXTURES_ROOT#

Path subclass for non-Windows systems.

On a POSIX system, instantiating a Path should return this object.

MODULE_ROOT#

Path subclass for non-Windows systems.

On a POSIX system, instantiating a Path should return this object.

PROJECT_ROOT#

Path subclass for non-Windows systems.

On a POSIX system, instantiating a Path should return this object.

TESTS_ROOT#

Path subclass for non-Windows systems.

On a POSIX system, instantiating a Path should return this object.

TOOLS_ROOT#

Path subclass for non-Windows systems.

On a POSIX system, instantiating a Path should return this object.

parametrize#

parametrize(arg_names:Iterable[str], arg_values:Iterable[Iterable[Any]])

Decorator to create parameterized tests.

Parameters

  • arg_names : Iterable[str], required. Argument names to pass to the test function.
  • arg_values : Iterable[Iterable[Any]], required. Iterable of values to pass to each of the args. The decorated test will be run for each inner iterable.