File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 22
33import glob
44import os .path
5+ import subprocess
6+
7+ import pytest
58
69from check_python_h_first .wrapper import (
710 diff_files ,
1922def test_sort_order ():
2023 """Test that the sort function puts headers first."""
2124 result = sorted (SOURCE_LIST + HEADER_LIST , key = sort_order )
22- assert result == HEADER_LIST + SOURCE_LIST
25+ # assert result == HEADER_LIST + SOURCE_LIST
26+ result_extensions = [os .path .splitext (name )[1 ] for name in result ]
27+ c_index = result_extensions .index (".c" )
28+ assert all (ext == ".h" for ext in result_extensions [:c_index ])
29+ assert all (ext == ".c" for ext in result_extensions [c_index :])
2330
2431
2532def test_find_c_cpp_files ():
@@ -40,6 +47,11 @@ def test_process_files():
4047 )
4148
4249
50+ @pytest .mark .xfail (
51+ os .environ .get ("GITHUB_ACTIONS" , "false" ) == "true" ,
52+ reason = "GHA does a shallow clone, without the history needed for this test." ,
53+ raises = subprocess .CalledProcessError ,
54+ )
4355def test_diff_files ():
4456 """Test whether diff_files picks up the correct files."""
4557 new_files = [os .path .basename (name ) for name in diff_files ("c8bda44" )]
You can’t perform that action at this time.
0 commit comments