From 94ed9b08f29e47248740514e77504e476cf03522 Mon Sep 17 00:00:00 2001 From: Rambaud Pierrick <12rambau@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:23:22 -0700 Subject: [PATCH] fix: accept all alternative extentions for copier.yaml (#51) --- pytest_copie/plugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pytest_copie/plugin.py b/pytest_copie/plugin.py index 38fbea1..17f73e1 100644 --- a/pytest_copie/plugin.py +++ b/pytest_copie/plugin.py @@ -60,7 +60,11 @@ def copy( """ # set the template dir and the associated copier.yaml file template_dir = template_dir or self.default_template_dir - copier_yaml = template_dir / "copier.yaml" + files = template_dir.glob("copier.*") + try: + copier_yaml = next(f for f in files if f.suffix in [".yaml", ".yml"]) + except StopIteration: + raise FileNotFoundError("No copier.yaml configuration file found.") # create a new output_dir in the test dir based on the counter value (output_dir := self.test_dir / f"copie{self.counter:03d}").mkdir()