File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 11import logging
22import os
3+ from pathlib import Path
4+
5+ import pytest
36
47from codegen .sdk .testing .models import Size
58
@@ -74,3 +77,29 @@ def pytest_configure(config):
7477 filename = f"build/logs/tests_{ worker_id } .log" ,
7578 level = config .getini ("log_file_level" ),
7679 )
80+
81+
82+ def is_git_lfs_pointer (file_path : Path ) -> bool :
83+ """Check if a file is a git LFS pointer file"""
84+ try :
85+ with open (file_path ) as f :
86+ first_line = f .readline ().strip ()
87+ return first_line == "version https://git-lfs.github.com/spec/v1"
88+ except Exception :
89+ return False
90+
91+
92+ @pytest .fixture (autouse = True )
93+ def skip_lfs_tests (request ):
94+ """Skip tests that depend on git LFS files if they haven't been pulled"""
95+ # Get the test module path
96+ test_path = Path (request .module .__file__ )
97+
98+ # Only run for integration tests
99+ if not str (test_path ).startswith (str (Path .cwd () / "tests" / "integration" )):
100+ return
101+
102+ # Get the expected diff path from the test's expected fixture
103+ expected = request .getfixturevalue ("expected" )
104+ if isinstance (expected , Path ) and is_git_lfs_pointer (expected ):
105+ pytest .skip (f"Test requires git LFS file { expected } which hasn't been pulled" )
You can’t perform that action at this time.
0 commit comments