Skip to content

Commit e5b2e15

Browse files
committed
TST: fix test when not executed from git checkout
Fixes #397.
1 parent 46c4c9c commit e5b2e15

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/test_project.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import mesonpy
2121

22-
from .conftest import chdir, package_dir
22+
from .conftest import chdir, in_git_repo_context, package_dir
2323

2424

2525
@pytest.mark.parametrize(
@@ -92,8 +92,9 @@ def wrapper(self, cmd):
9292
'install-args': ('cli-install',),
9393
}
9494

95-
mesonpy.build_sdist(tmp_path, config_settings)
96-
mesonpy.build_wheel(tmp_path, config_settings)
95+
with in_git_repo_context():
96+
mesonpy.build_sdist(tmp_path, config_settings)
97+
mesonpy.build_wheel(tmp_path, config_settings)
9798

9899
# check that the right commands are executed, namely that 'meson
99100
# compile' is used on Windows rather than a 'ninja' direct

0 commit comments

Comments
 (0)