Skip to content

Commit db902bb

Browse files
author
Damien Barker
committed
QPR-13690 add conftest to copy over expected output
1 parent 5de04b4 commit db902bb

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from pathlib import Path
2+
import shutil
3+
4+
5+
def copy_existing_files(test_path):
6+
output_dir = Path(test_path) / "Output"
7+
expected_dir = Path(test_path) / "ExpectedOutput"
8+
9+
if not output_dir.exists() or not expected_dir.exists():
10+
print("One of the directories does not exist.")
11+
return
12+
13+
for file in output_dir.iterdir():
14+
if file.is_file():
15+
target = expected_dir / file.name
16+
if target.exists():
17+
shutil.copy2(file, target)
18+
print(f"Copied {file.name} to ExpectedOutput")
19+
else:
20+
print(f"Skipped {file.name} (not in ExpectedOutput)")

0 commit comments

Comments
 (0)