mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Tests pass on windows
This commit is contained in:
parent
56e5c4eb2d
commit
143ed94500
21 changed files with 224 additions and 109 deletions
|
|
@ -1,5 +1,5 @@
|
|||
- id: system-hook-with-spaces
|
||||
name: System hook with spaces
|
||||
entry: /usr/bin/python -c 'import sys; print("Hello World")'
|
||||
entry: bash -c 'echo "Hello World"'
|
||||
language: system
|
||||
files: \.sh$
|
||||
|
|
|
|||
|
|
@ -49,8 +49,27 @@ def is_valid_according_to_schema(obj, schema):
|
|||
return False
|
||||
|
||||
|
||||
def skipif_slowtests_false(func):
|
||||
return pytest.mark.skipif(
|
||||
os.environ.get('slowtests') == 'false',
|
||||
reason='slowtests=false',
|
||||
)(func)
|
||||
skipif_slowtests_false = pytest.mark.skipif(
|
||||
os.environ.get('slowtests') == 'false',
|
||||
reason='slowtests=false',
|
||||
)
|
||||
|
||||
xfailif_windows_no_ruby = pytest.mark.xfail(
|
||||
os.name == 'nt',
|
||||
reason='Ruby support not yet implemented on windows.',
|
||||
)
|
||||
|
||||
xfailif_windows_no_node = pytest.mark.xfail(
|
||||
os.name == 'nt',
|
||||
reason='Node support not yet implemented on windows.',
|
||||
)
|
||||
|
||||
|
||||
def platform_supports_pcre():
|
||||
return cmd_output('grep', '-P', '', os.devnull, retcode=None)[0] == 1
|
||||
|
||||
|
||||
xfailif_no_pcre_support = pytest.mark.xfail(
|
||||
not platform_supports_pcre(),
|
||||
reason='grep -P is not supported on this platform',
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue