2121import os
2222import json
2323import posixpath
24- from unittest .case import skipIf
2524
25+ import pytest
26+
27+ from commoncode import fileutils
2628from commoncode .testcase import FileBasedTesting
2729from commoncode .system import on_windows
28- from commoncode import fileutils
2930
3031from extractcode import ExtractErrorFailedToExtract
3132from extractcode import sevenzip
@@ -135,7 +136,7 @@ def test_extract_of_tar_with_aboslute_path(self):
135136
136137class TestSevenZipListEntries (TestSevenZip ):
137138
138- @skipIf ( on_windows , 'Windows file-by-file extracton is not working well' )
139+ @pytest . mark . xfail ( not on_windows , reason = 'Windows file-by-file extracton is not working well' )
139140 def test_list_entries_of_special_tar (self ):
140141 test_loc = self .get_test_loc ('sevenzip/special.tar' )
141142 expected_loc = test_loc + '-entries-expected.json'
@@ -145,7 +146,7 @@ def test_list_entries_of_special_tar(self):
145146 results = entries + errors
146147 self .check_results_with_expected_json (results , expected_loc , regen = False )
147148
148- @skipIf ( not on_windows , 'Windows file-by-file extracton is not working well' )
149+ @pytest . mark . xfail ( on_windows , reason = 'Windows file-by-file extracton is not working well' )
149150 def test_list_entries_of_special_tar_win (self ):
150151 test_loc = self .get_test_loc ('sevenzip/special.tar' )
151152 expected_loc = test_loc + '-entries-expected-win.json'
@@ -155,7 +156,7 @@ def test_list_entries_of_special_tar_win(self):
155156 results = entries + errors
156157 self .check_results_with_expected_json (results , expected_loc , clean_dates = True , regen = False )
157158
158- @skipIf ( on_windows , 'Windows file-by-file extracton is not working well' )
159+ @pytest . mark . xfail ( not on_windows , reason = 'Windows file-by-file extracton is not working well' )
159160 def test_list_entries_with_weird_names_7z (self ):
160161 test_loc = self .get_test_loc ('sevenzip/weird_names.7z' )
161162 expected_loc = test_loc + '-entries-expected.json'
@@ -165,7 +166,7 @@ def test_list_entries_with_weird_names_7z(self):
165166 results = entries + errors
166167 self .check_results_with_expected_json (results , expected_loc , regen = False )
167168
168- @skipIf ( not on_windows , 'Windows file-by-file extracton is not working well' )
169+ @pytest . mark . xfail ( on_windows , reason = 'Windows file-by-file extracton is not working well' )
169170 def test_list_entries_with_weird_names_7z_win (self ):
170171 test_loc = self .get_test_loc ('sevenzip/weird_names.7z' )
171172 expected_loc = test_loc + '-entries-expected-win.json'
@@ -288,6 +289,7 @@ def test_extract_file_by_file_with_weird_names_7z(self):
288289 def test_extract_file_by_file_weird_names_zip (self ):
289290 self .check_extract_file_by_file ('sevenzip/weird_names.zip' , regen = False )
290291
292+ @pytest .mark .xfail (on_windows , reason = 'Fails on Windows becasue it has file names that cannot be extracted there' )
291293 def test_extract_file_by_file_weird_names_ar (self ):
292294 self .check_extract_file_by_file ('sevenzip/weird_names.ar' , regen = False )
293295
0 commit comments