Julia language: skip startup.jl file

This commit is contained in:
Eric Hanson 2025-07-21 18:05:54 +02:00 committed by anthony sottile
parent c6817210b1
commit 6f1f433a9c
2 changed files with 17 additions and 2 deletions

View file

@ -1,5 +1,8 @@
from __future__ import annotations
import os
from unittest import mock
from pre_commit.languages import julia
from testing.language_helpers import run_language
from testing.util import cwd
@ -28,6 +31,17 @@ def test_julia_hook(tmp_path):
assert run_language(tmp_path, julia, 'src/main.jl') == expected
def test_julia_hook_with_startup(tmp_path):
depot_path = tmp_path.joinpath('depot')
depot_path.joinpath('config').mkdir(parents=True)
startup = depot_path.joinpath('config', 'startup.jl')
startup.write_text('error("Startup file used!")\n')
depo_path_var = f'{depot_path}{os.pathsep}'
with mock.patch.dict(os.environ, {'JULIA_DEPOT_PATH': depo_path_var}):
test_julia_hook(tmp_path)
def test_julia_hook_manifest(tmp_path):
code = """
using Example