mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-23 14:19:58 +00:00
## Problem `TYPE_CHECKING` is used inconsistently across Python tests. ## Summary of changes - Update `ruff`: 0.7.0 -> 0.11.2 - Enable TC (flake8-type-checking): https://docs.astral.sh/ruff/rules/#flake8-type-checking-tc - (auto)fix all new issues
36 lines
877 B
Python
36 lines
877 B
Python
from __future__ import annotations
|
|
|
|
import os
|
|
from typing import TYPE_CHECKING
|
|
|
|
import pytest
|
|
from fixtures.log_helper import log
|
|
|
|
if TYPE_CHECKING:
|
|
from fixtures.neon_fixtures import NeonEnv
|
|
|
|
"""
|
|
Use this test to see what happens when tests fail.
|
|
|
|
We should be able to clean up after ourselves, including stopping any
|
|
postgres or pageserver processes.
|
|
|
|
Set the environment variable RUN_BROKEN to see this test run (and fail,
|
|
and hopefully not leave any server processes behind).
|
|
"""
|
|
|
|
run_broken = pytest.mark.skipif(
|
|
os.environ.get("RUN_BROKEN") is None, reason="only used for testing the fixtures"
|
|
)
|
|
|
|
|
|
@run_broken
|
|
def test_broken(neon_simple_env: NeonEnv, pg_bin):
|
|
env = neon_simple_env
|
|
|
|
env.endpoints.create_start("main")
|
|
log.info("postgres is running")
|
|
|
|
log.info("THIS NEXT COMMAND WILL FAIL:")
|
|
pg_bin.run("pgbench -i_am_a_broken_test".split())
|