> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Session.reset()

> Session.reset() → [None](https://docs.python.org/3/builtins/constants.html#None)

Bring the session back to the state it was in right after [`start()`](./atoti.Session.start#atoti.Session.start) returned.

Resetting a session is equivalent to the code below, but much faster since it neither stops nor starts a JVM:

```python theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
session.close()
session = tt.Session.start(config)
```

The main use case is to save resources in tests.
For example, a [pytest fixture](https://docs.pytest.org/en/9.0.x/how-to/fixtures.html#scope-sharing-fixtures-across-classes-modules-packages-or-session) can start a single session for all the tests and reset it after each of them:

```python theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
from collections.abc import Generator

import atoti as tt
import pytest


@pytest.fixture(scope="session")
def _session() -> Generator[tt.Session]:
    with tt.Session.start() as session:
        yield session


@pytest.fixture
def session(_session: tt.Session) -> Generator[tt.Session]:
    yield _session
    _session.reset()
```

```pycon theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
>>> table = session.create_table("Example", data_types={"ID": "String"})
>>> list(session.tables)
['Example']
>>> session.reset()
>>> list(session.tables)
[]
```

> [!NOTE]
>
> Added in version 6.2.4.
