Merge branch 'main' into eph/jl-version

This commit is contained in:
Eric Hanson 2025-08-18 19:14:46 +02:00 committed by GitHub
commit 623af3b5f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 34 additions and 9 deletions

View file

@ -10,7 +10,7 @@ from testing.language_helpers import run_language
def test_dart(tmp_path):
pubspec_yaml = '''\
environment:
sdk: '>=2.10.0 <3.0.0'
sdk: '>=2.12.0 <4.0.0'
name: hello_world_dart

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
@ -27,7 +30,6 @@ def test_julia_hook(tmp_path):
expected = (0, b'Hello, world!\n')
assert run_language(tmp_path, julia, 'src/main.jl') == expected
def test_julia_hook_version(tmp_path):
code = """
using Example
@ -43,6 +45,15 @@ def test_julia_hook_version(tmp_path):
version='1.10.10',
) == 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 = """