mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 16:44:42 +04:00
Merge branch 'main' into eph/jl-version
This commit is contained in:
commit
623af3b5f5
8 changed files with 34 additions and 9 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue