# tf.compat.v1.test.get_temp_dir

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/platform/test.py#L59-L75) |

Returns a temporary directory for use during tests.

    tf.compat.v1.test.get_temp_dir()

<br />

## Migrate to TF2

<br />

> [!CAUTION]
> **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.

This function is removed in TF2. Please use [`TestCase.get_temp_dir`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/utils/test_utils/TestCase#get_temp_dir) instead
in a test case.
Outside of a unit test, obtain a temporary directory through Python's
`tempfile` module.

<br />

<br />

## Description

There is no need to delete the directory after the test.

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The temporary directory. ||

<br />