mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
deep listdir works in python3 on windows
This commit is contained in:
parent
5779f93ec6
commit
5706b9149c
3 changed files with 4 additions and 30 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import contextlib
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -46,27 +45,6 @@ xfailif_windows_no_ruby = pytest.mark.xfail(
|
|||
xfailif_windows = pytest.mark.xfail(os.name == 'nt', reason='windows')
|
||||
|
||||
|
||||
def broken_deep_listdir(): # pragma: no cover (platform specific)
|
||||
if sys.platform != 'win32':
|
||||
return False
|
||||
try:
|
||||
os.listdir('\\\\?\\' + os.path.abspath('.'))
|
||||
except OSError:
|
||||
return True
|
||||
try:
|
||||
os.listdir(b'\\\\?\\C:' + b'\\' * 300)
|
||||
except TypeError:
|
||||
return True
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
xfailif_broken_deep_listdir = pytest.mark.xfail(
|
||||
broken_deep_listdir(),
|
||||
reason='Node on windows requires deep listdir',
|
||||
)
|
||||
|
||||
|
||||
xfailif_no_symlink = pytest.mark.xfail(
|
||||
not hasattr(os, 'symlink'),
|
||||
reason='Symlink is not supported on this platform',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue