Skip to content

Commit

Permalink
Update conftest.py to force garbage collection
Browse files Browse the repository at this point in the history
  • Loading branch information
blozano-tt authored Dec 10, 2024
1 parent 1a2ccda commit 8b82811
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

import pytest
import gc
import torch
import random
import os
Expand All @@ -23,6 +24,12 @@

from tests.scripts.common import run_process_and_get_result

@pytest.fixture(autouse=True)
def force_gc():
"""Force garbage collection after every test."""
yield # Run the test
gc.collect() # Trigger garbage collection after the test completes


@pytest.fixture(scope="function")
def reset_seeds():
Expand Down

0 comments on commit 8b82811

Please sign in to comment.