mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-25 17:10:38 +00:00
Explain preserve_database_files propogation a bit more
Co-authored-by: Christian Schwarz <christian@neon.tech>
This commit is contained in:
@@ -1440,6 +1440,8 @@ def neon_env_builder(
|
||||
) as builder:
|
||||
yield builder
|
||||
if builder.preserve_database_files:
|
||||
# Propogate `preserve_database_files` to make it possible to use in other fixtures,
|
||||
# like `test_output_dir` fixture for attaching all database files to Allure report.
|
||||
request.node.user_properties.append(("preserve_database_files", True))
|
||||
|
||||
|
||||
@@ -4104,6 +4106,9 @@ def test_output_dir(
|
||||
|
||||
preserve_database_files = False
|
||||
for k, v in request.node.user_properties:
|
||||
# NB: the neon_env_builder fixture uses this fixture (test_output_dir).
|
||||
# So, neon_env_builder's cleanup runs before here.
|
||||
# The cleanup propagates NeonEnvBuilder.preserve_database_files into this user property.
|
||||
if k == "preserve_database_files":
|
||||
assert isinstance(v, bool)
|
||||
preserve_database_files = v
|
||||
|
||||
Reference in New Issue
Block a user