1
0
Fork 0

Adding upstream version 2.18.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:32:53 +01:00
parent 9c7f59905e
commit 75996f15a7
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
116 changed files with 718 additions and 410 deletions

View file

@ -1,7 +1,10 @@
from __future__ import annotations
import os.path
import pytest
from pre_commit import envcontext
from pre_commit.languages import r
from testing.fixtures import make_config_from_repo
from testing.fixtures import make_repo
@ -127,3 +130,14 @@ def test_r_parsing_file_local(tempdir_factory, store):
config=config,
expect_path_prefix=False,
)
def test_rscript_exec_relative_to_r_home():
expected = os.path.join('r_home_dir', 'bin', 'Rscript')
with envcontext.envcontext((('R_HOME', 'r_home_dir'),)):
assert r._rscript_exec() == expected
def test_path_rscript_exec_no_r_home_set():
with envcontext.envcontext((('R_HOME', envcontext.UNSET),)):
assert r._rscript_exec() == 'Rscript'