mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-22 21:59:59 +00:00
The previous tests really didn't do much. This set should be quite a bit more encompassing. Signed-off-by: Tristan Partin <tristan@neon.tech>
35 lines
876 B
Python
35 lines
876 B
Python
from __future__ import annotations
|
|
|
|
import os
|
|
from typing import TYPE_CHECKING
|
|
|
|
import pytest
|
|
|
|
from fixtures.paths import BASE_DIR
|
|
|
|
if TYPE_CHECKING:
|
|
from collections.abc import Iterator
|
|
from pathlib import Path
|
|
|
|
COMPUTE_MIGRATIONS_DIR = BASE_DIR / "compute_tools" / "src" / "migrations"
|
|
COMPUTE_MIGRATIONS_TEST_DIR = COMPUTE_MIGRATIONS_DIR / "tests"
|
|
|
|
COMPUTE_MIGRATIONS = sorted(next(os.walk(COMPUTE_MIGRATIONS_DIR))[2])
|
|
NUM_COMPUTE_MIGRATIONS = len(COMPUTE_MIGRATIONS)
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def compute_migrations_dir() -> Iterator[Path]:
|
|
"""
|
|
Retrieve the path to the compute migrations directory.
|
|
"""
|
|
yield COMPUTE_MIGRATIONS_DIR
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def compute_migrations_test_dir() -> Iterator[Path]:
|
|
"""
|
|
Retrieve the path to the compute migrations test directory.
|
|
"""
|
|
yield COMPUTE_MIGRATIONS_TEST_DIR
|