def setUpClass(cls):
    """Make sure the test dir exists and is empty."""
    cls.test_temp_dir = os.path.join(tf.test.get_temp_dir(), "encoder_test")
    shutil.rmtree(cls.test_temp_dir, ignore_errors=True)
    tf.gfile.MakeDirs(cls.test_temp_dir)
Make sure the test dir exists and is empty.
trax/data/text_encoder_test.py