mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Simplify cross version tests
This commit is contained in:
parent
c5030c8dca
commit
a506a1cac1
6 changed files with 8 additions and 11 deletions
|
|
@ -16,8 +16,6 @@ matrix:
|
|||
install: pip install coveralls tox
|
||||
script: tox
|
||||
before_install:
|
||||
# work around https://github.com/travis-ci/travis-ci/issues/8363
|
||||
- which python3.5 || (pyenv install 3.5.4 && pyenv global system 3.5.4)
|
||||
- git --version
|
||||
- |
|
||||
if [ "$LATEST_GIT" = "1" ]; then
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@
|
|||
- The complete test suite depends on having at least the following installed (possibly not
|
||||
a complete list)
|
||||
- git (A sufficiently newer version is required to run pre-push tests)
|
||||
- python
|
||||
- python3.4 (Required by a test which checks different python versions)
|
||||
- python3.5 (Required by a test which checks different python versions)
|
||||
- python2 (Required by a test which checks different python versions)
|
||||
- python3 (Required by a test which checks different python versions)
|
||||
- tox (or virtualenv)
|
||||
- ruby + gem
|
||||
- docker
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
name: Python 3 Hook
|
||||
entry: python3-hook
|
||||
language: python
|
||||
language_version: python3.5
|
||||
language_version: python3
|
||||
files: \.py$
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
name: Python 3 Hook
|
||||
entry: python3-hook
|
||||
language: python
|
||||
language_version: python3.5
|
||||
language_version: python3
|
||||
files: \.py$
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import sys
|
|||
|
||||
|
||||
def func():
|
||||
print('{}.{}'.format(*sys.version_info[:2]))
|
||||
print(sys.version_info[0])
|
||||
print(repr(sys.argv[1:]))
|
||||
print('Hello World')
|
||||
return 0
|
||||
|
|
|
|||
|
|
@ -130,8 +130,8 @@ def test_switch_language_versions_doesnt_clobber(tempdir_factory, store):
|
|||
assert ret[0] == 0
|
||||
assert _norm_out(ret[1]) == expected_output
|
||||
|
||||
run_on_version('python3.4', b'3.4\n[]\nHello World\n')
|
||||
run_on_version('python3.5', b'3.5\n[]\nHello World\n')
|
||||
run_on_version('python2', b'2\n[]\nHello World\n')
|
||||
run_on_version('python3', b'3\n[]\nHello World\n')
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
|
|
@ -140,7 +140,7 @@ def test_versioned_python_hook(tempdir_factory, store):
|
|||
tempdir_factory, store, 'python3_hooks_repo',
|
||||
'python3-hook',
|
||||
[os.devnull],
|
||||
b"3.5\n['" + five.to_bytes(os.devnull) + b"']\nHello World\n",
|
||||
b"3\n['" + five.to_bytes(os.devnull) + b"']\nHello World\n",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue