File: conftest.py

package info (click to toggle)
python-filelock 3.24.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 328 kB
  • sloc: python: 3,513; makefile: 3
file content (20 lines) | stat: -rw-r--r-- 509 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from __future__ import annotations

import gc
import sys

try:
    from filelock._read_write import _cleanup_connections
except ImportError:
    _cleanup_connections = None  # type: ignore[assignment, misc]


def pytest_sessionfinish() -> None:
    if _cleanup_connections is not None:
        if hasattr(sys, "pypy_version_info"):
            gc.collect()
            gc.collect()
        _cleanup_connections()
        if hasattr(sys, "pypy_version_info"):
            gc.collect()
            gc.collect()