Mock Version: 1.4.21 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/pre-commit.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'ru_UA.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseprintOutput=True) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/pre-commit.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'ru_UA.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1575763200 Wrote: /builddir/build/SRPMS/pre-commit-1.20.0-1.fc32.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/originals/pre-commit.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'ru_UA.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseprintOutput=True) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/originals/pre-commit.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'ru_UA.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1575763200 Wrote: /builddir/build/SRPMS/pre-commit-1.20.0-1.fc32.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/originals/pre-commit.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'ru_UA.UTF-8'}shell=Falselogger=timeout=0uid=1000gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseprintOutput=True) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/originals/pre-commit.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'ru_UA.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1575763200 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.aadUBr + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf pre-commit-1.20.0 + /usr/bin/gzip -dc /builddir/build/SOURCES/pre-commit-1.20.0.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd pre-commit-1.20.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + rm -rf pre-commit.egg-info + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.lp5y0s + umask 022 + cd /builddir/build/BUILD + cd pre-commit-1.20.0 + CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s' running build running build_py creating build creating build/lib creating build/lib/pre_commit copying pre_commit/git.py -> build/lib/pre_commit copying pre_commit/file_lock.py -> build/lib/pre_commit copying pre_commit/envcontext.py -> build/lib/pre_commit copying pre_commit/output.py -> build/lib/pre_commit copying pre_commit/make_archives.py -> build/lib/pre_commit copying pre_commit/color.py -> build/lib/pre_commit copying pre_commit/store.py -> build/lib/pre_commit copying pre_commit/__init__.py -> build/lib/pre_commit copying pre_commit/logging_handler.py -> build/lib/pre_commit copying pre_commit/main.py -> build/lib/pre_commit copying pre_commit/staged_files_only.py -> build/lib/pre_commit copying pre_commit/clientlib.py -> build/lib/pre_commit copying pre_commit/constants.py -> build/lib/pre_commit copying pre_commit/color_windows.py -> build/lib/pre_commit copying pre_commit/util.py -> build/lib/pre_commit copying pre_commit/prefix.py -> build/lib/pre_commit copying pre_commit/error_handler.py -> build/lib/pre_commit copying pre_commit/parse_shebang.py -> build/lib/pre_commit copying pre_commit/five.py -> build/lib/pre_commit copying pre_commit/repository.py -> build/lib/pre_commit copying pre_commit/__main__.py -> build/lib/pre_commit copying pre_commit/xargs.py -> build/lib/pre_commit creating build/lib/pre_commit/languages copying pre_commit/languages/golang.py -> build/lib/pre_commit/languages copying pre_commit/languages/script.py -> build/lib/pre_commit/languages copying pre_commit/languages/__init__.py -> build/lib/pre_commit/languages copying pre_commit/languages/pcre.py -> build/lib/pre_commit/languages copying pre_commit/languages/all.py -> build/lib/pre_commit/languages copying pre_commit/languages/rust.py -> build/lib/pre_commit/languages copying pre_commit/languages/node.py -> build/lib/pre_commit/languages copying pre_commit/languages/helpers.py -> build/lib/pre_commit/languages copying pre_commit/languages/pygrep.py -> build/lib/pre_commit/languages copying pre_commit/languages/fail.py -> build/lib/pre_commit/languages copying pre_commit/languages/docker_image.py -> build/lib/pre_commit/languages copying pre_commit/languages/python_venv.py -> build/lib/pre_commit/languages copying pre_commit/languages/system.py -> build/lib/pre_commit/languages copying pre_commit/languages/ruby.py -> build/lib/pre_commit/languages copying pre_commit/languages/python.py -> build/lib/pre_commit/languages copying pre_commit/languages/docker.py -> build/lib/pre_commit/languages copying pre_commit/languages/swift.py -> build/lib/pre_commit/languages creating build/lib/pre_commit/commands copying pre_commit/commands/migrate_config.py -> build/lib/pre_commit/commands copying pre_commit/commands/__init__.py -> build/lib/pre_commit/commands copying pre_commit/commands/clean.py -> build/lib/pre_commit/commands copying pre_commit/commands/gc.py -> build/lib/pre_commit/commands copying pre_commit/commands/init_templatedir.py -> build/lib/pre_commit/commands copying pre_commit/commands/autoupdate.py -> build/lib/pre_commit/commands copying pre_commit/commands/try_repo.py -> build/lib/pre_commit/commands copying pre_commit/commands/install_uninstall.py -> build/lib/pre_commit/commands copying pre_commit/commands/sample_config.py -> build/lib/pre_commit/commands copying pre_commit/commands/run.py -> build/lib/pre_commit/commands creating build/lib/pre_commit/resources copying pre_commit/resources/__init__.py -> build/lib/pre_commit/resources copying pre_commit/resources/empty_template_setup.py -> build/lib/pre_commit/resources creating build/lib/pre_commit/meta_hooks copying pre_commit/meta_hooks/__init__.py -> build/lib/pre_commit/meta_hooks copying pre_commit/meta_hooks/identity.py -> build/lib/pre_commit/meta_hooks copying pre_commit/meta_hooks/check_hooks_apply.py -> build/lib/pre_commit/meta_hooks copying pre_commit/meta_hooks/check_useless_excludes.py -> build/lib/pre_commit/meta_hooks copying pre_commit/resources/rbenv.tar.gz -> build/lib/pre_commit/resources copying pre_commit/resources/ruby-download.tar.gz -> build/lib/pre_commit/resources copying pre_commit/resources/ruby-build.tar.gz -> build/lib/pre_commit/resources copying pre_commit/resources/empty_template_main.rs -> build/lib/pre_commit/resources copying pre_commit/resources/empty_template_main.go -> build/lib/pre_commit/resources copying pre_commit/resources/empty_template_Cargo.toml -> build/lib/pre_commit/resources copying pre_commit/resources/empty_template_package.json -> build/lib/pre_commit/resources copying pre_commit/resources/empty_template_.npmignore -> build/lib/pre_commit/resources copying pre_commit/resources/empty_template_pre_commit_dummy_package.gemspec -> build/lib/pre_commit/resources copying pre_commit/resources/hook-tmpl -> build/lib/pre_commit/resources + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.w1tTGs + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64 ++ dirname /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64 + cd pre-commit-1.20.0 + CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' + /usr/bin/python3 setup.py install -O1 --skip-build --root /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64 running install running install_lib creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8 creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/git.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/file_lock.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/envcontext.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/output.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/make_archives.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/color.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/store.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/golang.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/script.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/__init__.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/pcre.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/all.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/rust.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/node.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/helpers.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/pygrep.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/fail.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/docker_image.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/python_venv.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/system.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/ruby.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/python.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/docker.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/languages/swift.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages copying build/lib/pre_commit/__init__.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/logging_handler.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/main.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/staged_files_only.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/clientlib.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/constants.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/color_windows.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/util.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/prefix.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/error_handler.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/parse_shebang.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/migrate_config.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/__init__.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/clean.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/gc.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/init_templatedir.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/autoupdate.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/try_repo.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/install_uninstall.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/sample_config.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands copying build/lib/pre_commit/commands/run.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/empty_template_main.rs -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/empty_template_main.go -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/rbenv.tar.gz -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/__init__.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/empty_template_Cargo.toml -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/empty_template_package.json -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/hook-tmpl -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/empty_template_.npmignore -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/empty_template_setup.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/ruby-download.tar.gz -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/empty_template_pre_commit_dummy_package.gemspec -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources copying build/lib/pre_commit/resources/ruby-build.tar.gz -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources creating /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks copying build/lib/pre_commit/meta_hooks/__init__.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks copying build/lib/pre_commit/meta_hooks/identity.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks copying build/lib/pre_commit/meta_hooks/check_hooks_apply.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks copying build/lib/pre_commit/meta_hooks/check_useless_excludes.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks copying build/lib/pre_commit/five.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/repository.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/__main__.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit copying build/lib/pre_commit/xargs.py -> /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/git.py to git.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/file_lock.py to file_lock.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/envcontext.py to envcontext.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/output.py to output.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/make_archives.py to make_archives.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/color.py to color.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/store.py to store.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/golang.py to golang.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/script.py to script.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/__init__.py to __init__.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/pcre.py to pcre.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/all.py to all.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/rust.py to rust.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/node.py to node.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/helpers.py to helpers.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/pygrep.py to pygrep.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/fail.py to fail.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/docker_image.py to docker_image.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/python_venv.py to python_venv.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/system.py to system.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/ruby.py to ruby.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/python.py to python.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/docker.py to docker.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/languages/swift.py to swift.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/__init__.py to __init__.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/logging_handler.py to logging_handler.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/main.py to main.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/staged_files_only.py to staged_files_only.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/clientlib.py to clientlib.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/constants.py to constants.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/color_windows.py to color_windows.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/util.py to util.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/prefix.py to prefix.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/error_handler.py to error_handler.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/parse_shebang.py to parse_shebang.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/migrate_config.py to migrate_config.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/__init__.py to __init__.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/clean.py to clean.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/gc.py to gc.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/init_templatedir.py to init_templatedir.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/autoupdate.py to autoupdate.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/try_repo.py to try_repo.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/install_uninstall.py to install_uninstall.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/sample_config.py to sample_config.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/commands/run.py to run.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources/__init__.py to __init__.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/resources/empty_template_setup.py to empty_template_setup.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks/__init__.py to __init__.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks/identity.py to identity.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks/check_hooks_apply.py to check_hooks_apply.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/meta_hooks/check_useless_excludes.py to check_useless_excludes.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/five.py to five.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/repository.py to repository.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/__main__.py to __main__.cpython-38.pyc byte-compiling /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit/xargs.py to xargs.cpython-38.pyc writing byte-compilation script '/tmp/tmp24qecvi_.py' /usr/bin/python3 /tmp/tmp24qecvi_.py removing /tmp/tmp24qecvi_.py running install_egg_info running egg_info creating pre_commit.egg-info writing pre_commit.egg-info/PKG-INFO writing dependency_links to pre_commit.egg-info/dependency_links.txt writing entry points to pre_commit.egg-info/entry_points.txt writing requirements to pre_commit.egg-info/requires.txt writing top-level names to pre_commit.egg-info/top_level.txt writing manifest file 'pre_commit.egg-info/SOURCES.txt' reading manifest file 'pre_commit.egg-info/SOURCES.txt' writing manifest file 'pre_commit.egg-info/SOURCES.txt' Copying pre_commit.egg-info to /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8/site-packages/pre_commit-1.20.0-py3.8.egg-info running install_scripts Installing pre-commit script to /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/bin Installing pre-commit-validate-config script to /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/bin Installing pre-commit-validate-manifest script to /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/bin + /usr/lib/rpm/find-debuginfo.sh -j4 --strict-build-id -m -i --build-id-seed 1.20.0-1.fc32 --unique-debug-suffix -1.20.0-1.fc32.x86_64 --unique-debug-src-base pre-commit-1.20.0-1.fc32.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/pre-commit-1.20.0 find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/redhat/brp-python-bytecompile /usr/bin/python 1 0 Bytecompiling .py files below /builddir/build/BUILDROOT/pre-commit-1.20.0-1.fc32.x86_64/usr/lib/python3.8 using /usr/bin/python3.8 + /usr/lib/rpm/brp-python-hardlink + /usr/lib/rpm/redhat/brp-mangle-shebangs mangling shebang in /usr/lib/python3.8/site-packages/pre_commit/resources/hook-tmpl from /usr/bin/env python3 to #!/usr/bin/python3 Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.vA0jmr + umask 022 + cd /builddir/build/BUILD + cd pre-commit-1.20.0 + git config --global user.email you@example.com + git config --global user.name 'Your Name' + GIT_AUTHOR_NAME=test + export GIT_AUTHOR_NAME + GIT_AUTHOR_EMAIL=test@example.org + export GIT_AUTHOR_EMAIL + GIT_AUTHOR_DATE='2007-01-01 00:00:00 +0000' + export GIT_AUTHOR_DATE + GIT_COMMITTER_NAME=test + export GIT_COMMITTER_NAME + GIT_COMMITTER_EMAIL=test@example.org + export GIT_COMMITTER_EMAIL + GIT_COMMITTER_DATE='2007-01-01 00:00:00 +0000' + export GIT_COMMITTER_DATE + /usr/bin/python3 -m pytest -v ============================= test session starts ============================== platform linux -- Python 3.8.0, pytest-4.6.6, py-1.8.0, pluggy-0.13.0 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /builddir/build/BUILD/pre-commit-1.20.0, inifile: tox.ini collecting ... collected 608 items tests/clientlib_test.py::test_check_type_tag_failures[definitely-not-a-tag] PASSED [ 0%] tests/clientlib_test.py::test_check_type_tag_failures[fiel] PASSED [ 0%] tests/clientlib_test.py::test_config_valid[config_obj0-True] PASSED [ 0%] tests/clientlib_test.py::test_config_valid[config_obj1-True] PASSED [ 0%] tests/clientlib_test.py::test_config_valid[config_obj2-False] PASSED [ 0%] tests/clientlib_test.py::test_local_hooks_with_rev_fails PASSED [ 0%] tests/clientlib_test.py::test_config_with_local_hooks_definition_passes PASSED [ 1%] tests/clientlib_test.py::test_config_schema_does_not_contain_defaults PASSED [ 1%] tests/clientlib_test.py::test_validate_manifest_main_ok PASSED [ 1%] tests/clientlib_test.py::test_validate_config_main_ok PASSED [ 1%] tests/clientlib_test.py::test_validate_config_old_list_format_ok PASSED [ 1%] tests/clientlib_test.py::test_validate_warn_on_unknown_keys_at_repo_level PASSED [ 1%] tests/clientlib_test.py::test_validate_warn_on_unknown_keys_at_top_level PASSED [ 2%] tests/clientlib_test.py::test_mains_not_ok[validate_config_main] PASSED [ 2%] tests/clientlib_test.py::test_mains_not_ok[validate_manifest_main] PASSED [ 2%] tests/clientlib_test.py::test_valid_manifests[manifest_obj0-True] PASSED [ 2%] tests/clientlib_test.py::test_valid_manifests[manifest_obj1-True] PASSED [ 2%] tests/clientlib_test.py::test_valid_manifests[manifest_obj2-True] PASSED [ 2%] tests/clientlib_test.py::test_migrate_sha_to_rev_ok[dct0] PASSED [ 3%] tests/clientlib_test.py::test_migrate_sha_to_rev_ok[dct1] PASSED [ 3%] tests/clientlib_test.py::test_migrate_sha_to_rev_ok[dct2] PASSED [ 3%] tests/clientlib_test.py::test_migrate_sha_to_rev_ok[dct3] PASSED [ 3%] tests/clientlib_test.py::test_migrate_sha_to_rev_dont_specify_both PASSED [ 3%] tests/clientlib_test.py::test_migrate_sha_to_rev_conditional_check_failures[dct0] PASSED [ 3%] tests/clientlib_test.py::test_migrate_sha_to_rev_conditional_check_failures[dct1] PASSED [ 4%] tests/clientlib_test.py::test_migrate_sha_to_rev_conditional_check_failures[dct2] PASSED [ 4%] tests/clientlib_test.py::test_migrate_to_sha_apply_default PASSED [ 4%] tests/clientlib_test.py::test_migrate_to_sha_ok PASSED [ 4%] tests/clientlib_test.py::test_meta_hook_invalid[config_repo0] PASSED [ 4%] tests/clientlib_test.py::test_meta_hook_invalid[config_repo1] PASSED [ 4%] tests/clientlib_test.py::test_meta_hook_invalid[config_repo2] PASSED [ 5%] tests/clientlib_test.py::test_default_language_version_invalid[mapping0] PASSED [ 5%] tests/clientlib_test.py::test_default_language_version_invalid[mapping1] PASSED [ 5%] tests/clientlib_test.py::test_minimum_pre_commit_version_failing PASSED [ 5%] tests/clientlib_test.py::test_minimum_pre_commit_version_passing PASSED [ 5%] tests/clientlib_test.py::test_warn_additional[schema0] PASSED [ 5%] tests/clientlib_test.py::test_warn_additional[schema1] PASSED [ 6%] tests/color_test.py::test_format_color[foo-\x1b[42m-True-\x1b[42mfoo\x1b[0m] PASSED [ 6%] tests/color_test.py::test_format_color[foo-\x1b[42m-False-foo] PASSED [ 6%] tests/color_test.py::test_use_color_never PASSED [ 6%] tests/color_test.py::test_use_color_always PASSED [ 6%] tests/color_test.py::test_use_color_no_tty PASSED [ 6%] tests/color_test.py::test_use_color_tty_with_color_support PASSED [ 7%] tests/color_test.py::test_use_color_tty_without_color_support PASSED [ 7%] tests/color_test.py::test_use_color_dumb_term PASSED [ 7%] tests/color_test.py::test_use_color_raises_if_given_shenanigans PASSED [ 7%] tests/envcontext_test.py::test_trivial PASSED [ 7%] tests/envcontext_test.py::test_noop PASSED [ 7%] tests/envcontext_test.py::test_adds PASSED [ 8%] tests/envcontext_test.py::test_overrides PASSED [ 8%] tests/envcontext_test.py::test_unset_but_nothing_to_unset PASSED [ 8%] tests/envcontext_test.py::test_unset_things_to_remove PASSED [ 8%] tests/envcontext_test.py::test_templated_environment_variable_missing PASSED [ 8%] tests/envcontext_test.py::test_templated_environment_variable_defaults PASSED [ 8%] tests/envcontext_test.py::test_templated_environment_variable_there PASSED [ 9%] tests/envcontext_test.py::test_templated_environ_sources_from_previous PASSED [ 9%] tests/envcontext_test.py::test_exception_safety PASSED [ 9%] tests/envcontext_test.py::test_integration_os_environ PASSED [ 9%] tests/error_handler_test.py::test_error_handler_no_exception PASSED [ 9%] tests/error_handler_test.py::test_error_handler_fatal_error PASSED [ 9%] tests/error_handler_test.py::test_error_handler_uncaught_error PASSED [ 10%] tests/error_handler_test.py::test_error_handler_keyboardinterrupt PASSED [ 10%] tests/error_handler_test.py::test_log_and_exit PASSED [ 10%] tests/error_handler_test.py::test_error_handler_non_ascii_exception PASSED [ 10%] tests/error_handler_test.py::test_error_handler_no_tty PASSED [ 10%] tests/git_test.py::test_get_root_at_root PASSED [ 10%] tests/git_test.py::test_get_root_deeper PASSED [ 11%] tests/git_test.py::test_get_staged_files_deleted PASSED [ 11%] tests/git_test.py::test_is_not_in_merge_conflict PASSED [ 11%] tests/git_test.py::test_is_in_merge_conflict PASSED [ 11%] tests/git_test.py::test_is_in_merge_conflict_submodule PASSED [ 11%] tests/git_test.py::test_cherry_pick_conflict PASSED [ 11%] tests/git_test.py::test_get_conflicted_files PASSED [ 12%] tests/git_test.py::test_get_conflicted_files_in_submodule PASSED [ 12%] tests/git_test.py::test_get_conflicted_files_unstaged_files PASSED [ 12%] tests/git_test.py::test_parse_merge_msg_for_conflicts[Merge branch 'foo' into bar\n\nConflicts:\n\tconflict_file\n-expected_output0] PASSED [ 12%] tests/git_test.py::test_parse_merge_msg_for_conflicts[Merge branch 'foo' into bar\n\nConflicts:\n\tconflict_file\n\tother_conflict_file\n-expected_output1] PASSED [ 12%] tests/git_test.py::test_get_changed_files PASSED [ 12%] tests/git_test.py::test_zsplit[foo\x00bar\x00-expected0] PASSED [ 12%] tests/git_test.py::test_zsplit[foo\x00-expected1] PASSED [ 13%] tests/git_test.py::test_zsplit[-expected2] PASSED [ 13%] tests/git_test.py::test_zsplit[foo-expected3] PASSED [ 13%] tests/git_test.py::test_all_files_non_ascii PASSED [ 13%] tests/git_test.py::test_staged_files_non_ascii PASSED [ 13%] tests/git_test.py::test_changed_files_non_ascii PASSED [ 13%] tests/git_test.py::test_get_conflicted_files_non_ascii PASSED [ 14%] tests/git_test.py::test_intent_to_add PASSED [ 14%] tests/git_test.py::test_status_output_with_rename PASSED [ 14%] tests/git_test.py::test_no_git_env PASSED [ 14%] tests/logging_handler_test.py::test_logging_handler_color PASSED [ 14%] tests/logging_handler_test.py::test_logging_handler_no_color PASSED [ 14%] tests/main_test.py::test_append_replace_default[argv0-expected0] PASSED [ 15%] tests/main_test.py::test_append_replace_default[argv1-expected1] PASSED [ 15%] tests/main_test.py::test_append_replace_default[argv2-expected2] PASSED [ 15%] tests/main_test.py::test_adjust_args_and_chdir_not_in_git_dir PASSED [ 15%] tests/main_test.py::test_adjust_args_and_chdir_noop PASSED [ 15%] tests/main_test.py::test_adjust_args_and_chdir_relative_things PASSED [ 15%] tests/main_test.py::test_adjust_args_and_chdir_non_relative_config PASSED [ 16%] tests/main_test.py::test_adjust_args_try_repo_repo_relative PASSED [ 16%] tests/main_test.py::test_overall_help PASSED [ 16%] tests/main_test.py::test_help_command PASSED [ 16%] tests/main_test.py::test_help_other_command PASSED [ 16%] tests/main_test.py::test_all_cmds[autoupdate] FAILED [ 16%] tests/main_test.py::test_all_cmds[clean] PASSED [ 17%] tests/main_test.py::test_all_cmds[gc] PASSED [ 17%] tests/main_test.py::test_all_cmds[install] FAILED [ 17%] tests/main_test.py::test_all_cmds[install-hooks] FAILED [ 17%] tests/main_test.py::test_all_cmds[migrate-config] FAILED [ 17%] tests/main_test.py::test_all_cmds[run] FAILED [ 17%] tests/main_test.py::test_all_cmds[sample-config] PASSED [ 18%] tests/main_test.py::test_all_cmds[uninstall] FAILED [ 18%] tests/main_test.py::test_try_repo FAILED [ 18%] tests/main_test.py::test_init_templatedir PASSED [ 18%] tests/main_test.py::test_help_cmd_in_empty_directory PASSED [ 18%] tests/main_test.py::test_expected_fatal_error_no_git_repo PASSED [ 18%] tests/main_test.py::test_warning_on_tags_only FAILED [ 19%] tests/make_archives_test.py::test_make_archive PASSED [ 19%] tests/make_archives_test.py::test_main PASSED [ 19%] tests/output_test.py::test_get_hook_message_raises[kwargs0] PASSED [ 19%] tests/output_test.py::test_get_hook_message_raises[kwargs1] PASSED [ 19%] tests/output_test.py::test_get_hook_message_raises[kwargs2] PASSED [ 19%] tests/output_test.py::test_get_hook_message_raises[kwargs3] PASSED [ 20%] tests/output_test.py::test_get_hook_message_raises[kwargs4] PASSED [ 20%] tests/output_test.py::test_case_with_end_len PASSED [ 20%] tests/output_test.py::test_case_with_end_msg PASSED [ 20%] tests/output_test.py::test_case_with_end_msg_using_color PASSED [ 20%] tests/output_test.py::test_case_with_postfix_message PASSED [ 20%] tests/output_test.py::test_make_sure_postfix_is_not_colored PASSED [ 21%] tests/output_test.py::test_output_write_writes PASSED [ 21%] tests/parse_shebang_test.py::test_file_doesnt_exist PASSED [ 21%] tests/parse_shebang_test.py::test_simple_case PASSED [ 21%] tests/parse_shebang_test.py::test_find_executable_full_path PASSED [ 21%] tests/parse_shebang_test.py::test_find_executable_on_path PASSED [ 21%] tests/parse_shebang_test.py::test_find_executable_not_found_none PASSED [ 22%] tests/parse_shebang_test.py::test_find_executable_path_added PASSED [ 22%] tests/parse_shebang_test.py::test_find_executable_path_ext PASSED [ 22%] tests/parse_shebang_test.py::test_normexe_does_not_exist PASSED [ 22%] tests/parse_shebang_test.py::test_normexe_does_not_exist_sep PASSED [ 22%] tests/parse_shebang_test.py::test_normexe_not_executable PASSED [ 22%] tests/parse_shebang_test.py::test_normexe_is_a_directory PASSED [ 23%] tests/parse_shebang_test.py::test_normexe_already_full_path PASSED [ 23%] tests/parse_shebang_test.py::test_normexe_gives_full_path PASSED [ 23%] tests/parse_shebang_test.py::test_normalize_cmd_trivial PASSED [ 23%] tests/parse_shebang_test.py::test_normalize_cmd_PATH FAILED [ 23%] tests/parse_shebang_test.py::test_normalize_cmd_shebang FAILED [ 23%] tests/parse_shebang_test.py::test_normalize_cmd_PATH_shebang_full_path FAILED [ 24%] tests/parse_shebang_test.py::test_normalize_cmd_PATH_shebang_PATH FAILED [ 24%] tests/prefix_test.py::test_path[foo--foo] PASSED [ 24%] tests/prefix_test.py::test_path[foo-bar-foo/bar] PASSED [ 24%] tests/prefix_test.py::test_path[foo/bar-../baz-foo/baz] PASSED [ 24%] tests/prefix_test.py::test_path[./-bar-bar] PASSED [ 24%] tests/prefix_test.py::test_path[./--.] PASSED [ 25%] tests/prefix_test.py::test_path[/tmp/foo-/tmp/bar-/tmp/bar] PASSED [ 25%] tests/prefix_test.py::test_path_multiple_args PASSED [ 25%] tests/prefix_test.py::test_exists PASSED [ 25%] tests/prefix_test.py::test_star PASSED [ 25%] tests/repository_test.py::test_python_hook PASSED [ 25%] tests/repository_test.py::test_python_hook_default_version PASSED [ 25%] tests/repository_test.py::test_python_hook_args_with_spaces PASSED [ 26%] tests/repository_test.py::test_python_hook_weird_setup_cfg PASSED [ 26%] tests/repository_test.py::test_python_venv PASSED [ 26%] tests/repository_test.py::test_switch_language_versions_doesnt_clobber FAILED [ 26%] tests/repository_test.py::test_versioned_python_hook PASSED [ 26%] tests/repository_test.py::test_run_a_docker_hook SKIPPED [ 26%] tests/repository_test.py::test_run_a_docker_hook_with_entry_args SKIPPED [ 27%] tests/repository_test.py::test_run_a_failing_docker_hook SKIPPED [ 27%] tests/repository_test.py::test_run_a_docker_image_hook[echo-entrypoint] SKIPPED [ 27%] tests/repository_test.py::test_run_a_docker_image_hook[echo-cmd] SKIPPED [ 27%] tests/repository_test.py::test_run_a_node_hook PASSED [ 27%] tests/repository_test.py::test_run_versioned_node_hook PASSED [ 27%] tests/repository_test.py::test_run_a_ruby_hook FAILED [ 28%] tests/repository_test.py::test_run_versioned_ruby_hook FAILED [ 28%] tests/repository_test.py::test_run_ruby_hook_with_disable_shared_gems FAILED [ 28%] tests/repository_test.py::test_system_hook_with_spaces PASSED [ 28%] tests/repository_test.py::test_swift_hook SKIPPED [ 28%] tests/repository_test.py::test_golang_hook FAILED [ 28%] tests/repository_test.py::test_golang_hook_still_works_when_gobin_is_set FAILED [ 29%] tests/repository_test.py::test_rust_hook FAILED [ 29%] tests/repository_test.py::test_additional_rust_cli_dependencies_installed[cli:shellharden:3.1.0] FAILED [ 29%] tests/repository_test.py::test_additional_rust_cli_dependencies_installed[cli:shellharden] FAILED [ 29%] tests/repository_test.py::test_additional_rust_lib_dependencies_installed FAILED [ 29%] tests/repository_test.py::test_missing_executable PASSED [ 29%] tests/repository_test.py::test_run_a_script_hook PASSED [ 30%] tests/repository_test.py::test_run_hook_with_spaced_args PASSED [ 30%] tests/repository_test.py::test_run_hook_with_curly_braced_arguments PASSED [ 30%] tests/repository_test.py::test_intermixed_stdout_stderr FAILED [ 30%] tests/repository_test.py::test_output_isatty FAILED [ 30%] tests/repository_test.py::TestPygrep::test_grep_hook_matching FAILED [ 30%] tests/repository_test.py::TestPygrep::test_grep_hook_case_insensitive FAILED [ 31%] tests/repository_test.py::TestPygrep::test_grep_hook_not_matching[nope] FAILED [ 31%] tests/repository_test.py::TestPygrep::test_grep_hook_not_matching[foo'bar] FAILED [ 31%] tests/repository_test.py::TestPygrep::test_grep_hook_not_matching[^\\[INFO\\]] FAILED [ 31%] tests/repository_test.py::TestPCRE::test_grep_hook_matching PASSED [ 31%] tests/repository_test.py::TestPCRE::test_grep_hook_case_insensitive PASSED [ 31%] tests/repository_test.py::TestPCRE::test_grep_hook_not_matching[nope] PASSED [ 32%] tests/repository_test.py::TestPCRE::test_grep_hook_not_matching[foo'bar] PASSED [ 32%] tests/repository_test.py::TestPCRE::test_grep_hook_not_matching[^\\[INFO\\]] PASSED [ 32%] tests/repository_test.py::TestPCRE::test_pcre_hook_many_files PASSED [ 32%] tests/repository_test.py::TestPCRE::test_missing_pcre_support PASSED [ 32%] tests/repository_test.py::test_cwd_of_hook PASSED [ 32%] tests/repository_test.py::test_lots_of_files PASSED [ 33%] tests/repository_test.py::test_additional_dependencies_roll_forward PASSED [ 33%] tests/repository_test.py::test_additional_ruby_dependencies_installed FAILED [ 33%] tests/repository_test.py::test_additional_node_dependencies_installed PASSED [ 33%] tests/repository_test.py::test_additional_golang_dependencies_installed FAILED [ 33%] tests/repository_test.py::test_local_golang_additional_dependencies FAILED [ 33%] tests/repository_test.py::test_local_rust_additional_dependencies FAILED [ 34%] tests/repository_test.py::test_fail_hooks PASSED [ 34%] tests/repository_test.py::test_unknown_keys PASSED [ 34%] tests/repository_test.py::test_reinstall PASSED [ 34%] tests/repository_test.py::test_control_c_control_c_on_install PASSED [ 34%] tests/repository_test.py::test_invalidated_virtualenv PASSED [ 34%] tests/repository_test.py::test_really_long_file_paths PASSED [ 35%] tests/repository_test.py::test_config_overrides_repo_specifics PASSED [ 35%] tests/repository_test.py::test_tags_on_repositories PASSED [ 35%] tests/repository_test.py::test_local_python_repo PASSED [ 35%] tests/repository_test.py::test_default_language_version PASSED [ 35%] tests/repository_test.py::test_default_stages PASSED [ 35%] tests/repository_test.py::test_hook_id_not_present PASSED [ 36%] tests/repository_test.py::test_too_new_version PASSED [ 36%] tests/repository_test.py::test_versions_ok[0.1.0] PASSED [ 36%] tests/repository_test.py::test_versions_ok[1.20.0] PASSED [ 36%] tests/repository_test.py::test_manifest_hooks PASSED [ 36%] tests/staged_files_only_test.py::test_foo_staged PASSED [ 36%] tests/staged_files_only_test.py::test_foo_nothing_unstaged PASSED [ 37%] tests/staged_files_only_test.py::test_foo_something_unstaged PASSED [ 37%] tests/staged_files_only_test.py::test_does_not_crash_patch_dir_does_not_exist PASSED [ 37%] tests/staged_files_only_test.py::test_something_unstaged_ext_diff_tool PASSED [ 37%] tests/staged_files_only_test.py::test_foo_something_unstaged_diff_color_always PASSED [ 37%] tests/staged_files_only_test.py::test_foo_both_modify_non_conflicting PASSED [ 37%] tests/staged_files_only_test.py::test_foo_both_modify_conflicting PASSED [ 37%] tests/staged_files_only_test.py::test_img_staged PASSED [ 38%] tests/staged_files_only_test.py::test_img_nothing_unstaged PASSED [ 38%] tests/staged_files_only_test.py::test_img_something_unstaged PASSED [ 38%] tests/staged_files_only_test.py::test_img_conflict PASSED [ 38%] tests/staged_files_only_test.py::test_sub_staged PASSED [ 38%] tests/staged_files_only_test.py::test_sub_nothing_unstaged PASSED [ 38%] tests/staged_files_only_test.py::test_sub_something_unstaged PASSED [ 39%] tests/staged_files_only_test.py::test_stage_utf8_changes PASSED [ 39%] tests/staged_files_only_test.py::test_stage_non_utf8_changes PASSED [ 39%] tests/staged_files_only_test.py::test_non_utf8_conflicting_diff PASSED [ 39%] tests/staged_files_only_test.py::test_crlf[true-True-True] PASSED [ 39%] tests/staged_files_only_test.py::test_crlf[true-True-False] PASSED [ 39%] tests/staged_files_only_test.py::test_crlf[true-False-True] PASSED [ 40%] tests/staged_files_only_test.py::test_crlf[true-False-False] PASSED [ 40%] tests/staged_files_only_test.py::test_crlf[false-True-True] PASSED [ 40%] tests/staged_files_only_test.py::test_crlf[false-True-False] PASSED [ 40%] tests/staged_files_only_test.py::test_crlf[false-False-True] PASSED [ 40%] tests/staged_files_only_test.py::test_crlf[false-False-False] PASSED [ 40%] tests/staged_files_only_test.py::test_crlf[input-True-True] PASSED [ 41%] tests/staged_files_only_test.py::test_crlf[input-True-False] PASSED [ 41%] tests/staged_files_only_test.py::test_crlf[input-False-True] PASSED [ 41%] tests/staged_files_only_test.py::test_crlf[input-False-False] PASSED [ 41%] tests/staged_files_only_test.py::test_whitespace_errors PASSED [ 41%] tests/staged_files_only_test.py::test_autocrlf_committed_crlf PASSED [ 41%] tests/staged_files_only_test.py::test_intent_to_add PASSED [ 42%] tests/store_test.py::test_our_session_fixture_works PASSED [ 42%] tests/store_test.py::test_get_default_directory_defaults_to_home PASSED [ 42%] tests/store_test.py::test_adheres_to_xdg_specification PASSED [ 42%] tests/store_test.py::test_uses_environment_variable_when_present PASSED [ 42%] tests/store_test.py::test_store_init PASSED [ 42%] tests/store_test.py::test_clone PASSED [ 43%] tests/store_test.py::test_clone_cleans_up_on_checkout_failure PASSED [ 43%] tests/store_test.py::test_clone_when_repo_already_exists PASSED [ 43%] tests/store_test.py::test_clone_shallow_failure_fallback_to_complete PASSED [ 43%] tests/store_test.py::test_clone_tag_not_on_mainline PASSED [ 43%] tests/store_test.py::test_create_when_directory_exists_but_not_db PASSED [ 43%] tests/store_test.py::test_create_when_store_already_exists PASSED [ 44%] tests/store_test.py::test_db_repo_name PASSED [ 44%] tests/store_test.py::test_local_resources_reflects_reality PASSED [ 44%] tests/store_test.py::test_mark_config_as_used PASSED [ 44%] tests/store_test.py::test_mark_config_as_used_idempotent PASSED [ 44%] tests/store_test.py::test_mark_config_as_used_does_not_exist PASSED [ 44%] tests/store_test.py::test_select_all_configs_roll_forward PASSED [ 45%] tests/store_test.py::test_mark_config_as_used_roll_forward PASSED [ 45%] tests/util_test.py::test_CalledProcessError_str PASSED [ 45%] tests/util_test.py::test_CalledProcessError_str_nooutput PASSED [ 45%] tests/util_test.py::test_clean_on_failure_noop PASSED [ 45%] tests/util_test.py::test_clean_path_on_failure_does_nothing_when_not_raising PASSED [ 45%] tests/util_test.py::test_clean_path_on_failure_cleans_for_normal_exception PASSED [ 46%] tests/util_test.py::test_clean_path_on_failure_cleans_for_system_exit PASSED [ 46%] tests/util_test.py::test_tmpdir PASSED [ 46%] tests/util_test.py::test_cmd_output_exe_not_found PASSED [ 46%] tests/util_test.py::test_cmd_output_p_exe_not_found PASSED [ 46%] tests/util_test.py::test_parse_version PASSED [ 46%] tests/util_test.py::test_rmtree_read_only_directories PASSED [ 47%] tests/xargs_test.py::test_environ_size[env0-0] PASSED [ 47%] tests/xargs_test.py::test_environ_size[env1-12] PASSED [ 47%] tests/xargs_test.py::test_environ_size[env2-13] PASSED [ 47%] tests/xargs_test.py::test_environ_size[env3-24] PASSED [ 47%] tests/xargs_test.py::test_partition_trivial PASSED [ 47%] tests/xargs_test.py::test_partition_simple PASSED [ 48%] tests/xargs_test.py::test_partition_limits PASSED [ 48%] tests/xargs_test.py::test_partition_limit_win32_py3 PASSED [ 48%] tests/xargs_test.py::test_partition_limit_win32_py2 PASSED [ 48%] tests/xargs_test.py::test_partition_limit_linux PASSED [ 48%] tests/xargs_test.py::test_argument_too_long_with_large_unicode PASSED [ 48%] tests/xargs_test.py::test_partition_target_concurrency PASSED [ 49%] tests/xargs_test.py::test_partition_target_concurrency_wont_make_tiny_partitions PASSED [ 49%] tests/xargs_test.py::test_argument_too_long PASSED [ 49%] tests/xargs_test.py::test_xargs_smoke PASSED [ 49%] tests/xargs_test.py::test_xargs_negate PASSED [ 49%] tests/xargs_test.py::test_xargs_negate_command_not_found PASSED [ 49%] tests/xargs_test.py::test_xargs_retcode_normal PASSED [ 50%] tests/xargs_test.py::test_xargs_concurrency PASSED [ 50%] tests/xargs_test.py::test_thread_mapper_concurrency_uses_threadpoolexecutor_map PASSED [ 50%] tests/xargs_test.py::test_thread_mapper_concurrency_uses_regular_map PASSED [ 50%] tests/xargs_test.py::test_xargs_propagate_kwargs_to_cmd PASSED [ 50%] tests/xargs_test.py::test_xargs_color_true_makes_tty PASSED [ 50%] tests/commands/autoupdate_test.py::test_up_to_date_repo PASSED [ 50%] tests/commands/autoupdate_test.py::test_autoupdate_up_to_date_repo PASSED [ 51%] tests/commands/autoupdate_test.py::test_autoupdate_old_revision_broken PASSED [ 51%] tests/commands/autoupdate_test.py::test_out_of_date_repo PASSED [ 51%] tests/commands/autoupdate_test.py::test_autoupdate_out_of_date_repo PASSED [ 51%] tests/commands/autoupdate_test.py::test_autoupdate_out_of_date_repo_with_correct_repo_name PASSED [ 51%] tests/commands/autoupdate_test.py::test_autoupdate_out_of_date_repo_with_wrong_repo_name PASSED [ 51%] tests/commands/autoupdate_test.py::test_does_not_reformat PASSED [ 52%] tests/commands/autoupdate_test.py::test_loses_formatting_when_not_detectable PASSED [ 52%] tests/commands/autoupdate_test.py::test_autoupdate_tagged_repo PASSED [ 52%] tests/commands/autoupdate_test.py::test_autoupdate_tags_only PASSED [ 52%] tests/commands/autoupdate_test.py::test_autoupdate_latest_no_config PASSED [ 52%] tests/commands/autoupdate_test.py::test_hook_disppearing_repo_raises PASSED [ 52%] tests/commands/autoupdate_test.py::test_autoupdate_hook_disappearing_repo PASSED [ 53%] tests/commands/autoupdate_test.py::test_autoupdate_non_master_default_branch PASSED [ 53%] tests/commands/autoupdate_test.py::test_autoupdate_local_hooks PASSED [ 53%] tests/commands/autoupdate_test.py::test_autoupdate_local_hooks_with_out_of_date_repo PASSED [ 53%] tests/commands/autoupdate_test.py::test_autoupdate_meta_hooks PASSED [ 53%] tests/commands/autoupdate_test.py::test_updates_old_format_to_new_format PASSED [ 53%] tests/commands/clean_test.py::test_clean PASSED [ 54%] tests/commands/clean_test.py::test_clean_idempotent PASSED [ 54%] tests/commands/gc_test.py::test_gc PASSED [ 54%] tests/commands/gc_test.py::test_gc_repo_not_cloned PASSED [ 54%] tests/commands/gc_test.py::test_gc_meta_repo_does_not_crash PASSED [ 54%] tests/commands/gc_test.py::test_gc_local_repo_does_not_crash PASSED [ 54%] tests/commands/gc_test.py::test_gc_unused_local_repo_with_env PASSED [ 55%] tests/commands/gc_test.py::test_gc_config_with_missing_hook PASSED [ 55%] tests/commands/gc_test.py::test_gc_deletes_invalid_configs PASSED [ 55%] tests/commands/gc_test.py::test_invalid_manifest_gcd PASSED [ 55%] tests/commands/init_templatedir_test.py::test_init_templatedir FAILED [ 55%] tests/commands/init_templatedir_test.py::test_init_templatedir_already_set PASSED [ 55%] tests/commands/init_templatedir_test.py::test_init_templatedir_not_set PASSED [ 56%] tests/commands/init_templatedir_test.py::test_init_templatedir_expanduser PASSED [ 56%] tests/commands/install_uninstall_test.py::test_is_not_script PASSED [ 56%] tests/commands/install_uninstall_test.py::test_is_script PASSED [ 56%] tests/commands/install_uninstall_test.py::test_is_previous_pre_commit PASSED [ 56%] tests/commands/install_uninstall_test.py::test_shebang_windows PASSED [ 56%] tests/commands/install_uninstall_test.py::test_shebang_posix_not_on_path PASSED [ 57%] tests/commands/install_uninstall_test.py::test_shebang_posix_on_path PASSED [ 57%] tests/commands/install_uninstall_test.py::test_install_pre_commit PASSED [ 57%] tests/commands/install_uninstall_test.py::test_install_hooks_directory_not_present PASSED [ 57%] tests/commands/install_uninstall_test.py::test_install_multiple_hooks_at_once PASSED [ 57%] tests/commands/install_uninstall_test.py::test_install_refuses_core_hookspath PASSED [ 57%] tests/commands/install_uninstall_test.py::test_install_hooks_dead_symlink PASSED [ 58%] tests/commands/install_uninstall_test.py::test_uninstall_does_not_blow_up_when_not_there PASSED [ 58%] tests/commands/install_uninstall_test.py::test_uninstall PASSED [ 58%] tests/commands/install_uninstall_test.py::test_install_pre_commit_and_run FAILED [ 58%] tests/commands/install_uninstall_test.py::test_install_pre_commit_and_run_custom_path FAILED [ 58%] tests/commands/install_uninstall_test.py::test_install_in_submodule_and_run FAILED [ 58%] tests/commands/install_uninstall_test.py::test_install_in_worktree_and_run FAILED [ 59%] tests/commands/install_uninstall_test.py::test_commit_am FAILED [ 59%] tests/commands/install_uninstall_test.py::test_unicode_merge_commit_message FAILED [ 59%] tests/commands/install_uninstall_test.py::test_install_idempotent FAILED [ 59%] tests/commands/install_uninstall_test.py::test_environment_not_sourced PASSED [ 59%] tests/commands/install_uninstall_test.py::test_failing_hooks_returns_nonzero FAILED [ 59%] tests/commands/install_uninstall_test.py::test_failing_hooks_returns_nonzero ERROR [ 59%] tests/commands/install_uninstall_test.py::test_install_existing_hooks_no_overwrite FAILED [ 60%] tests/commands/install_uninstall_test.py::test_legacy_overwriting_legacy_hook PASSED [ 60%] tests/commands/install_uninstall_test.py::test_install_existing_hook_no_overwrite_idempotent FAILED [ 60%] tests/commands/install_uninstall_test.py::test_failing_existing_hook_returns_1 FAILED [ 60%] tests/commands/install_uninstall_test.py::test_failing_existing_hook_returns_1 ERROR [ 60%] tests/commands/install_uninstall_test.py::test_install_overwrite_no_existing_hooks FAILED [ 60%] tests/commands/install_uninstall_test.py::test_install_overwrite FAILED [ 60%] tests/commands/install_uninstall_test.py::test_uninstall_restores_legacy_hooks PASSED [ 61%] tests/commands/install_uninstall_test.py::test_replace_old_commit_script FAILED [ 61%] tests/commands/install_uninstall_test.py::test_uninstall_doesnt_remove_not_our_hooks PASSED [ 61%] tests/commands/install_uninstall_test.py::test_installs_hooks_with_hooks_True FAILED [ 61%] tests/commands/install_uninstall_test.py::test_install_hooks_command FAILED [ 61%] tests/commands/install_uninstall_test.py::test_installed_from_venv FAILED [ 61%] tests/commands/install_uninstall_test.py::test_pre_push_integration_failing FAILED [ 62%] tests/commands/install_uninstall_test.py::test_pre_push_integration_accepted FAILED [ 62%] tests/commands/install_uninstall_test.py::test_pre_push_force_push_without_fetch FAILED [ 62%] tests/commands/install_uninstall_test.py::test_pre_push_new_upstream FAILED [ 62%] tests/commands/install_uninstall_test.py::test_pre_push_integration_empty_push FAILED [ 62%] tests/commands/install_uninstall_test.py::test_pre_push_legacy FAILED [ 62%] tests/commands/install_uninstall_test.py::test_commit_msg_integration_failing FAILED [ 62%] tests/commands/install_uninstall_test.py::test_commit_msg_integration_passing FAILED [ 63%] tests/commands/install_uninstall_test.py::test_commit_msg_legacy FAILED [ 63%] tests/commands/install_uninstall_test.py::test_prepare_commit_msg_integration_failing FAILED [ 63%] tests/commands/install_uninstall_test.py::test_prepare_commit_msg_integration_passing FAILED [ 63%] tests/commands/install_uninstall_test.py::test_prepare_commit_msg_legacy FAILED [ 63%] tests/commands/install_uninstall_test.py::test_install_disallow_missing_config PASSED [ 63%] tests/commands/install_uninstall_test.py::test_install_allow_missing_config PASSED [ 64%] tests/commands/install_uninstall_test.py::test_install_temporarily_allow_mising_config PASSED [ 64%] tests/commands/migrate_config_test.py::test_indent[-] PASSED [ 64%] tests/commands/migrate_config_test.py::test_indent[a- a] PASSED [ 64%] tests/commands/migrate_config_test.py::test_indent[foo\nbar- foo\n bar] PASSED [ 64%] tests/commands/migrate_config_test.py::test_indent[foo\n\nbar\n- foo\n\n bar\n] PASSED [ 64%] tests/commands/migrate_config_test.py::test_indent[\n\n\n-\n\n\n] PASSED [ 65%] tests/commands/migrate_config_test.py::test_migrate_config_normal_format PASSED [ 65%] tests/commands/migrate_config_test.py::test_migrate_config_document_marker PASSED [ 65%] tests/commands/migrate_config_test.py::test_migrate_config_list_literal PASSED [ 65%] tests/commands/migrate_config_test.py::test_already_migrated_configuration_noop PASSED [ 65%] tests/commands/migrate_config_test.py::test_migrate_config_sha_to_rev PASSED [ 65%] tests/commands/migrate_config_test.py::test_empty_configuration_file_user_error[] PASSED [ 66%] tests/commands/migrate_config_test.py::test_empty_configuration_file_user_error[\n] PASSED [ 66%] tests/commands/run_test.py::test_run_all_hooks_failing PASSED [ 66%] tests/commands/run_test.py::test_arbitrary_bytes_hook PASSED [ 66%] tests/commands/run_test.py::test_hook_that_modifies_but_returns_zero PASSED [ 66%] tests/commands/run_test.py::test_types_hook_repository PASSED [ 66%] tests/commands/run_test.py::test_exclude_types_hook_repository PASSED [ 67%] tests/commands/run_test.py::test_global_exclude PASSED [ 67%] tests/commands/run_test.py::test_show_diff_on_failure[args0-All changes made by hooks:] PASSED [ 67%] tests/commands/run_test.py::test_show_diff_on_failure[args1-All changes made by hooks:] PASSED [ 67%] tests/commands/run_test.py::test_show_diff_on_failure[args2-reproduce locally with: pre-commit run --all-files] PASSED [ 67%] tests/commands/run_test.py::test_run[options0-outputs0-0-True] PASSED [ 67%] tests/commands/run_test.py::test_run[options1-outputs1-0-True] PASSED [ 68%] tests/commands/run_test.py::test_run[options2-outputs2-0-True] PASSED [ 68%] tests/commands/run_test.py::test_run[options3-outputs3-1-True] PASSED [ 68%] tests/commands/run_test.py::test_run[options4-outputs4-1-True] PASSED [ 68%] tests/commands/run_test.py::test_run[options5-outputs5-0-True] PASSED [ 68%] tests/commands/run_test.py::test_run[options6-outputs6-0-True] PASSED [ 68%] tests/commands/run_test.py::test_run[options7-outputs7-0-False] PASSED [ 69%] tests/commands/run_test.py::test_run_output_logfile PASSED [ 69%] tests/commands/run_test.py::test_always_run PASSED [ 69%] tests/commands/run_test.py::test_always_run_alt_config PASSED [ 69%] tests/commands/run_test.py::test_hook_verbose_enabled PASSED [ 69%] tests/commands/run_test.py::test_origin_source_error_msg_error[master-] PASSED [ 69%] tests/commands/run_test.py::test_origin_source_error_msg_error[-master] PASSED [ 70%] tests/commands/run_test.py::test_origin_source_both_ok PASSED [ 70%] tests/commands/run_test.py::test_has_unmerged_paths PASSED [ 70%] tests/commands/run_test.py::test_merge_conflict PASSED [ 70%] tests/commands/run_test.py::test_merge_conflict_modified PASSED [ 70%] tests/commands/run_test.py::test_merge_conflict_resolved PASSED [ 70%] tests/commands/run_test.py::test_compute_cols[hooks0-True-80] PASSED [ 71%] tests/commands/run_test.py::test_compute_cols[hooks1-False-81] PASSED [ 71%] tests/commands/run_test.py::test_compute_cols[hooks2-True-85] PASSED [ 71%] tests/commands/run_test.py::test_compute_cols[hooks3-False-82] PASSED [ 71%] tests/commands/run_test.py::test_get_skips[environ0-expected_output0] PASSED [ 71%] tests/commands/run_test.py::test_get_skips[environ1-expected_output1] PASSED [ 71%] tests/commands/run_test.py::test_get_skips[environ2-expected_output2] PASSED [ 72%] tests/commands/run_test.py::test_get_skips[environ3-expected_output3] PASSED [ 72%] tests/commands/run_test.py::test_get_skips[environ4-expected_output4] PASSED [ 72%] tests/commands/run_test.py::test_get_skips[environ5-expected_output5] PASSED [ 72%] tests/commands/run_test.py::test_get_skips[environ6-expected_output6] PASSED [ 72%] tests/commands/run_test.py::test_skip_hook PASSED [ 72%] tests/commands/run_test.py::test_skip_aliased_hook PASSED [ 73%] tests/commands/run_test.py::test_hook_id_not_in_non_verbose_output PASSED [ 73%] tests/commands/run_test.py::test_hook_id_in_verbose_output PASSED [ 73%] tests/commands/run_test.py::test_multiple_hooks_same_id PASSED [ 73%] tests/commands/run_test.py::test_aliased_hook_run PASSED [ 73%] tests/commands/run_test.py::test_non_ascii_hook_id PASSED [ 73%] tests/commands/run_test.py::test_stdout_write_bug_py26 PASSED [ 74%] tests/commands/run_test.py::test_lots_of_files FAILED [ 74%] tests/commands/run_test.py::test_stages FAILED [ 74%] tests/commands/run_test.py::test_commit_msg_hook PASSED [ 74%] tests/commands/run_test.py::test_prepare_commit_msg_hook PASSED [ 74%] tests/commands/run_test.py::test_local_hook_passes FAILED [ 74%] tests/commands/run_test.py::test_local_hook_fails PASSED [ 75%] tests/commands/run_test.py::test_pcre_deprecation_warning PASSED [ 75%] tests/commands/run_test.py::test_meta_hook_passes PASSED [ 75%] tests/commands/run_test.py::test_error_with_unstaged_config PASSED [ 75%] tests/commands/run_test.py::test_no_unstaged_error_with_all_files_or_files[opts0] PASSED [ 75%] tests/commands/run_test.py::test_no_unstaged_error_with_all_files_or_files[opts1] PASSED [ 75%] tests/commands/run_test.py::test_files_running_subdir FAILED [ 75%] tests/commands/run_test.py::test_pass_filenames[True-hook_args0-foo.py] PASSED [ 76%] tests/commands/run_test.py::test_pass_filenames[False-hook_args1-] PASSED [ 76%] tests/commands/run_test.py::test_pass_filenames[True-hook_args2-some args foo.py] PASSED [ 76%] tests/commands/run_test.py::test_pass_filenames[False-hook_args3-some args] PASSED [ 76%] tests/commands/run_test.py::test_fail_fast PASSED [ 76%] tests/commands/run_test.py::test_classifier_removes_dne PASSED [ 76%] tests/commands/run_test.py::test_classifier_normalizes_filenames_on_windows_to_forward_slashes PASSED [ 77%] tests/commands/run_test.py::test_classifier_does_not_normalize_backslashes_non_windows PASSED [ 77%] tests/commands/run_test.py::test_include_exclude_base_case PASSED [ 77%] tests/commands/run_test.py::test_matches_broken_symlink PASSED [ 77%] tests/commands/run_test.py::test_include_exclude_total_match PASSED [ 77%] tests/commands/run_test.py::test_include_exclude_does_search_instead_of_match PASSED [ 77%] tests/commands/run_test.py::test_include_exclude_exclude_removes_files PASSED [ 78%] tests/commands/run_test.py::test_args_hook_only PASSED [ 78%] tests/commands/sample_config_test.py::test_sample_config PASSED [ 78%] tests/commands/try_repo_test.py::test_try_repo_repo_only PASSED [ 78%] tests/commands/try_repo_test.py::test_try_repo_with_specific_hook PASSED [ 78%] tests/commands/try_repo_test.py::test_try_repo_relative_path PASSED [ 78%] tests/commands/try_repo_test.py::test_try_repo_specific_revision PASSED [ 79%] tests/commands/try_repo_test.py::test_try_repo_uncommitted_changes PASSED [ 79%] tests/commands/try_repo_test.py::test_try_repo_staged_changes PASSED [ 79%] tests/languages/all_test.py::test_install_environment_argspec[docker] PASSED [ 79%] tests/languages/all_test.py::test_install_environment_argspec[docker_image] PASSED [ 79%] tests/languages/all_test.py::test_install_environment_argspec[fail] PASSED [ 79%] tests/languages/all_test.py::test_install_environment_argspec[golang] PASSED [ 80%] tests/languages/all_test.py::test_install_environment_argspec[node] PASSED [ 80%] tests/languages/all_test.py::test_install_environment_argspec[pcre] PASSED [ 80%] tests/languages/all_test.py::test_install_environment_argspec[pygrep] PASSED [ 80%] tests/languages/all_test.py::test_install_environment_argspec[python] PASSED [ 80%] tests/languages/all_test.py::test_install_environment_argspec[python_venv] PASSED [ 80%] tests/languages/all_test.py::test_install_environment_argspec[ruby] PASSED [ 81%] tests/languages/all_test.py::test_install_environment_argspec[rust] PASSED [ 81%] tests/languages/all_test.py::test_install_environment_argspec[script] PASSED [ 81%] tests/languages/all_test.py::test_install_environment_argspec[swift] PASSED [ 81%] tests/languages/all_test.py::test_install_environment_argspec[system] PASSED [ 81%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[docker] PASSED [ 81%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[docker_image] PASSED [ 82%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[fail] PASSED [ 82%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[golang] PASSED [ 82%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[node] PASSED [ 82%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[pcre] PASSED [ 82%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[pygrep] PASSED [ 82%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[python] PASSED [ 83%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[python_venv] PASSED [ 83%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[ruby] PASSED [ 83%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[rust] PASSED [ 83%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[script] PASSED [ 83%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[swift] PASSED [ 83%] tests/languages/all_test.py::test_ENVIRONMENT_DIR[system] PASSED [ 84%] tests/languages/all_test.py::test_run_hook_argpsec[docker] PASSED [ 84%] tests/languages/all_test.py::test_run_hook_argpsec[docker_image] PASSED [ 84%] tests/languages/all_test.py::test_run_hook_argpsec[fail] PASSED [ 84%] tests/languages/all_test.py::test_run_hook_argpsec[golang] PASSED [ 84%] tests/languages/all_test.py::test_run_hook_argpsec[node] PASSED [ 84%] tests/languages/all_test.py::test_run_hook_argpsec[pcre] PASSED [ 85%] tests/languages/all_test.py::test_run_hook_argpsec[pygrep] PASSED [ 85%] tests/languages/all_test.py::test_run_hook_argpsec[python] PASSED [ 85%] tests/languages/all_test.py::test_run_hook_argpsec[python_venv] PASSED [ 85%] tests/languages/all_test.py::test_run_hook_argpsec[ruby] PASSED [ 85%] tests/languages/all_test.py::test_run_hook_argpsec[rust] PASSED [ 85%] tests/languages/all_test.py::test_run_hook_argpsec[script] PASSED [ 86%] tests/languages/all_test.py::test_run_hook_argpsec[swift] PASSED [ 86%] tests/languages/all_test.py::test_run_hook_argpsec[system] PASSED [ 86%] tests/languages/all_test.py::test_get_default_version_argspec[docker] PASSED [ 86%] tests/languages/all_test.py::test_get_default_version_argspec[docker_image] PASSED [ 86%] tests/languages/all_test.py::test_get_default_version_argspec[fail] PASSED [ 86%] tests/languages/all_test.py::test_get_default_version_argspec[golang] PASSED [ 87%] tests/languages/all_test.py::test_get_default_version_argspec[node] PASSED [ 87%] tests/languages/all_test.py::test_get_default_version_argspec[pcre] PASSED [ 87%] tests/languages/all_test.py::test_get_default_version_argspec[pygrep] PASSED [ 87%] tests/languages/all_test.py::test_get_default_version_argspec[python] PASSED [ 87%] tests/languages/all_test.py::test_get_default_version_argspec[python_venv] PASSED [ 87%] tests/languages/all_test.py::test_get_default_version_argspec[ruby] PASSED [ 87%] tests/languages/all_test.py::test_get_default_version_argspec[rust] PASSED [ 88%] tests/languages/all_test.py::test_get_default_version_argspec[script] PASSED [ 88%] tests/languages/all_test.py::test_get_default_version_argspec[swift] PASSED [ 88%] tests/languages/all_test.py::test_get_default_version_argspec[system] PASSED [ 88%] tests/languages/all_test.py::test_healthy_argspec[docker] PASSED [ 88%] tests/languages/all_test.py::test_healthy_argspec[docker_image] PASSED [ 88%] tests/languages/all_test.py::test_healthy_argspec[fail] PASSED [ 89%] tests/languages/all_test.py::test_healthy_argspec[golang] PASSED [ 89%] tests/languages/all_test.py::test_healthy_argspec[node] PASSED [ 89%] tests/languages/all_test.py::test_healthy_argspec[pcre] PASSED [ 89%] tests/languages/all_test.py::test_healthy_argspec[pygrep] PASSED [ 89%] tests/languages/all_test.py::test_healthy_argspec[python] PASSED [ 89%] tests/languages/all_test.py::test_healthy_argspec[python_venv] PASSED [ 90%] tests/languages/all_test.py::test_healthy_argspec[ruby] PASSED [ 90%] tests/languages/all_test.py::test_healthy_argspec[rust] PASSED [ 90%] tests/languages/all_test.py::test_healthy_argspec[script] PASSED [ 90%] tests/languages/all_test.py::test_healthy_argspec[swift] PASSED [ 90%] tests/languages/all_test.py::test_healthy_argspec[system] PASSED [ 90%] tests/languages/docker_test.py::test_docker_is_running_process_error PASSED [ 91%] tests/languages/docker_test.py::test_docker_fallback_user PASSED [ 91%] tests/languages/golang_test.py::test_guess_go_dir[/im/a/path/on/disk-unknown_src_dir] PASSED [ 91%] tests/languages/golang_test.py::test_guess_go_dir[file:///im/a/path/on/disk-unknown_src_dir] PASSED [ 91%] tests/languages/golang_test.py::test_guess_go_dir[git@github.com:golang/lint-github.com/golang/lint] PASSED [ 91%] tests/languages/golang_test.py::test_guess_go_dir[git://github.com/golang/lint-github.com/golang/lint] PASSED [ 91%] tests/languages/golang_test.py::test_guess_go_dir[http://github.com/golang/lint-github.com/golang/lint] PASSED [ 92%] tests/languages/golang_test.py::test_guess_go_dir[https://github.com/golang/lint-github.com/golang/lint] PASSED [ 92%] tests/languages/golang_test.py::test_guess_go_dir[ssh://git@github.com/golang/lint-github.com/golang/lint] PASSED [ 92%] tests/languages/golang_test.py::test_guess_go_dir[git@github.com:golang/lint.git-github.com/golang/lint] PASSED [ 92%] tests/languages/helpers_test.py::test_basic_get_default_version PASSED [ 92%] tests/languages/helpers_test.py::test_basic_healthy PASSED [ 92%] tests/languages/helpers_test.py::test_failed_setup_command_does_not_unicode_error PASSED [ 93%] tests/languages/helpers_test.py::test_assert_no_additional_deps PASSED [ 93%] tests/languages/helpers_test.py::test_target_concurrency_normal PASSED [ 93%] tests/languages/helpers_test.py::test_target_concurrency_cpu_count_require_serial_true PASSED [ 93%] tests/languages/helpers_test.py::test_target_concurrency_testing_env_var PASSED [ 93%] tests/languages/helpers_test.py::test_target_concurrency_on_travis PASSED [ 93%] tests/languages/helpers_test.py::test_target_concurrency_cpu_count_not_implemented PASSED [ 94%] tests/languages/helpers_test.py::test_shuffled_is_deterministic PASSED [ 94%] tests/languages/pygrep_test.py::test_main[baz-0-] PASSED [ 94%] tests/languages/pygrep_test.py::test_main[foo-1-f1:1:foo\n] PASSED [ 94%] tests/languages/pygrep_test.py::test_main[bar-1-f1:2:bar\n] PASSED [ 94%] tests/languages/pygrep_test.py::test_main[(?i)\\[info\\]-1-f2:1:[INFO] hi\n] PASSED [ 94%] tests/languages/pygrep_test.py::test_main[h'q-1-f3:1:with'quotes\n] PASSED [ 95%] tests/languages/pygrep_test.py::test_ignore_case PASSED [ 95%] tests/languages/pygrep_test.py::test_multiline PASSED [ 95%] tests/languages/pygrep_test.py::test_multiline_line_number PASSED [ 95%] tests/languages/pygrep_test.py::test_multiline_dotall_flag_is_enabled PASSED [ 95%] tests/languages/pygrep_test.py::test_multiline_multiline_flag_is_enabled PASSED [ 95%] tests/languages/python_test.py::test_norm_version_expanduser PASSED [ 96%] tests/languages/python_test.py::test_sys_executable_matches[python3.6] PASSED [ 96%] tests/languages/python_test.py::test_sys_executable_matches[python3] PASSED [ 96%] tests/languages/python_test.py::test_sys_executable_matches[python] PASSED [ 96%] tests/languages/python_test.py::test_sys_executable_matches_does_not_match[notpython] PASSED [ 96%] tests/languages/python_test.py::test_sys_executable_matches_does_not_match[python3.x] PASSED [ 96%] tests/languages/python_test.py::test_find_by_sys_executable[/usr/bin/python3-/usr/bin/python3.7-python3] PASSED [ 97%] tests/languages/python_test.py::test_find_by_sys_executable[/usr/bin/python-/usr/bin/python3.7-python3.7] PASSED [ 97%] tests/languages/python_test.py::test_find_by_sys_executable[/usr/bin/python-/usr/bin/python-None] PASSED [ 97%] tests/languages/python_test.py::test_find_by_sys_executable[/usr/bin/python3.6m-/usr/bin/python3.6m-python3.6m] PASSED [ 97%] tests/languages/python_test.py::test_find_by_sys_executable[v/bin/python-v/bin/pypy-pypy] PASSED [ 97%] tests/languages/python_test.py::test_healthy_types_py_in_cwd FAILED [ 97%] tests/languages/ruby_test.py::test_install_rbenv PASSED [ 98%] tests/languages/ruby_test.py::test_install_rbenv_with_version PASSED [ 98%] tests/meta_hooks/check_hooks_apply_test.py::test_hook_excludes_everything PASSED [ 98%] tests/meta_hooks/check_hooks_apply_test.py::test_hook_includes_nothing PASSED [ 98%] tests/meta_hooks/check_hooks_apply_test.py::test_hook_types_not_matched PASSED [ 98%] tests/meta_hooks/check_hooks_apply_test.py::test_hook_types_excludes_everything PASSED [ 98%] tests/meta_hooks/check_hooks_apply_test.py::test_valid_exceptions PASSED [ 99%] tests/meta_hooks/check_useless_excludes_test.py::test_useless_exclude_global PASSED [ 99%] tests/meta_hooks/check_useless_excludes_test.py::test_useless_exclude_for_hook PASSED [ 99%] tests/meta_hooks/check_useless_excludes_test.py::test_useless_exclude_with_types_filter PASSED [ 99%] tests/meta_hooks/check_useless_excludes_test.py::test_no_excludes PASSED [ 99%] tests/meta_hooks/check_useless_excludes_test.py::test_valid_exclude PASSED [ 99%] tests/meta_hooks/identity_test.py::test_identity PASSED [100%] ==================================== ERRORS ==================================== ___________ ERROR at teardown of test_failing_hooks_returns_nonzero ____________ tp = , value = None, tb = None def reraise(tp, value, tb=None): try: if value is None: value = tp() if value.__traceback__ is not tb: raise value.with_traceback(tb) > raise value /usr/lib/python3.8/site-packages/six.py:693: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/six.py:693: in reraise raise value /usr/lib/python3.8/site-packages/six.py:693: in reraise raise value _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ recwarn = WarningsRecorder(record=True) @pytest.fixture(autouse=True) def no_warnings(recwarn): yield warnings = [] for warning in recwarn: # pragma: no cover message = str(warning.message) # ImportWarning: Not importing directory '...' missing __init__(.py) if not ( isinstance(warning.message, ImportWarning) and message.startswith('Not importing directory ') and ' missing __init__' in message ): warnings.append( '{}:{} {}'.format(warning.filename, warning.lineno, message), ) > assert not warnings E assert not ['/builddir/build/BUILD/pre-commit-1.20.0/tests/commands/install_uninstall_test.py:306 asserting the value None, please use "assert is None"'] tests/conftest.py:41: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit __________ ERROR at teardown of test_failing_existing_hook_returns_1 ___________ tp = , value = None, tb = None def reraise(tp, value, tb=None): try: if value is None: value = tp() if value.__traceback__ is not tb: raise value.with_traceback(tb) > raise value /usr/lib/python3.8/site-packages/six.py:693: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/six.py:693: in reraise raise value /usr/lib/python3.8/site-packages/six.py:693: in reraise raise value _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ recwarn = WarningsRecorder(record=True) @pytest.fixture(autouse=True) def no_warnings(recwarn): yield warnings = [] for warning in recwarn: # pragma: no cover message = str(warning.message) # ImportWarning: Not importing directory '...' missing __init__(.py) if not ( isinstance(warning.message, ImportWarning) and message.startswith('Not importing directory ') and ' missing __init__' in message ): warnings.append( '{}:{} {}'.format(warning.filename, warning.lineno, message), ) > assert not warnings E assert not ['/builddir/build/BUILD/pre-commit-1.20.0/tests/commands/install_uninstall_test.py:391 asserting the value None, please use "assert is None"'] tests/conftest.py:41: AssertionError ----------------------------- Captured stdout call ----------------------------- Running in migration mode with existing hooks at .git/hooks/pre-commit.legacy Use -f to use only pre-commit. pre-commit installed at .git/hooks/pre-commit =================================== FAILURES =================================== __________________________ test_all_cmds[autoupdate] ___________________________ args = Namespace(bleeding_edge=False, color=False, command='autoupdate', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml', repos=None, tags_only=False) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: > os.chdir(git.get_root()) pre_commit/main.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def get_root(): > return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip() pre_commit/git.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('git', 'rev-parse', '--show-toplevel'), kwargs = {} def cmd_output(*cmd, **kwargs): > returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) pre_commit/util.py:154: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'rev-parse', '--show-toplevel') kwargs = {'env': None, 'stderr': -1, 'stdin': -1, 'stdout': -1}, retcode = 0 returncode = 128, stdout_b = b'' stderr_b = b'fatal: not a git repository (or any of the parent directories): .git\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'rev-parse', '--show-toplevel') E Return code: 128 E Expected return code: 0 E Output: (none) E Errors: E fatal: not a git repository (or any of the parent directories): .git pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: @contextlib.contextmanager def error_handler(): try: > yield pre_commit/error_handler.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ argv = ['autoupdate'] def main(argv=None): argv = argv if argv is not None else sys.argv[1:] argv = [five.to_text(arg) for arg in argv] parser = argparse.ArgumentParser() # https://stackoverflow.com/a/8521644/812183 parser.add_argument( '-V', '--version', action='version', version='%(prog)s {}'.format(C.VERSION), ) subparsers = parser.add_subparsers(dest='command') autoupdate_parser = subparsers.add_parser( 'autoupdate', help="Auto-update pre-commit config to the latest repos' versions.", ) _add_color_option(autoupdate_parser) _add_config_option(autoupdate_parser) autoupdate_parser.add_argument( '--tags-only', action='store_true', help='LEGACY: for compatibility', ) autoupdate_parser.add_argument( '--bleeding-edge', action='store_true', help=( 'Update to the bleeding edge of `master` instead of the latest ' 'tagged version (the default behavior).' ), ) autoupdate_parser.add_argument( '--repo', dest='repos', action='append', metavar='REPO', help='Only update this repository -- may be specified multiple times.', ) clean_parser = subparsers.add_parser( 'clean', help='Clean out pre-commit files.', ) _add_color_option(clean_parser) _add_config_option(clean_parser) gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.') _add_color_option(gc_parser) _add_config_option(gc_parser) init_templatedir_parser = subparsers.add_parser( 'init-templatedir', help=( 'Install hook script in a directory intended for use with ' '`git config init.templateDir`.' ), ) _add_color_option(init_templatedir_parser) _add_config_option(init_templatedir_parser) init_templatedir_parser.add_argument( 'directory', help='The directory in which to write the hook script.', ) _add_hook_type_option(init_templatedir_parser) install_parser = subparsers.add_parser( 'install', help='Install the pre-commit script.', ) _add_color_option(install_parser) _add_config_option(install_parser) install_parser.add_argument( '-f', '--overwrite', action='store_true', help='Overwrite existing hooks / remove migration mode.', ) install_parser.add_argument( '--install-hooks', action='store_true', help=( 'Whether to install hook environments for all environments ' 'in the config file.' ), ) _add_hook_type_option(install_parser) install_parser.add_argument( '--allow-missing-config', action='store_true', default=False, help=( 'Whether to allow a missing `pre-commit` configuration file ' 'or exit with a failure code.' ), ) install_hooks_parser = subparsers.add_parser( 'install-hooks', help=( 'Install hook environments for all environments in the config ' 'file. You may find `pre-commit install --install-hooks` more ' 'useful.' ), ) _add_color_option(install_hooks_parser) _add_config_option(install_hooks_parser) migrate_config_parser = subparsers.add_parser( 'migrate-config', help='Migrate list configuration to new map configuration.', ) _add_color_option(migrate_config_parser) _add_config_option(migrate_config_parser) run_parser = subparsers.add_parser('run', help='Run hooks.') _add_color_option(run_parser) _add_config_option(run_parser) _add_run_options(run_parser) sample_config_parser = subparsers.add_parser( 'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE), ) _add_color_option(sample_config_parser) _add_config_option(sample_config_parser) try_repo_parser = subparsers.add_parser( 'try-repo', help='Try the hooks in a repository, useful for developing new hooks.', ) _add_color_option(try_repo_parser) _add_config_option(try_repo_parser) try_repo_parser.add_argument( 'repo', help='Repository to source hooks from.', ) try_repo_parser.add_argument( '--ref', '--rev', help=( 'Manually select a rev to run against, otherwise the `HEAD` ' 'revision will be used.' ), ) _add_run_options(try_repo_parser) uninstall_parser = subparsers.add_parser( 'uninstall', help='Uninstall the pre-commit script.', ) _add_color_option(uninstall_parser) _add_config_option(uninstall_parser) _add_hook_type_option(uninstall_parser) help = subparsers.add_parser( 'help', help='Show help for a specific command.', ) help.add_argument('help_cmd', nargs='?', help='Command to show help for.') # argparse doesn't really provide a way to use a `default` subparser if len(argv) == 0: argv = ['run'] args = parser.parse_args(argv) if args.command == 'help' and args.help_cmd: parser.parse_args([args.help_cmd, '--help']) elif args.command == 'help': parser.parse_args(['--help']) with error_handler(), logging_handler(args.color): if args.command not in COMMANDS_NO_GIT: > _adjust_args_and_chdir(args) pre_commit/main.py:294: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = Namespace(bleeding_edge=False, color=False, command='autoupdate', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml', repos=None, tags_only=False) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: os.chdir(git.get_root()) except CalledProcessError: > raise FatalError( 'git failed. Is it installed, and are you in a Git repository ' 'directory?', ) E pre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory? pre_commit/main.py:127: FatalError During handling of the above exception, another exception occurred: command = 'autoupdate' mock_commands = auto_namedtuple(autoupdate=, clean=, uninstall=) mock_store_dir = '/tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_autoupdate_0/0' @pytest.mark.parametrize('command', CMDS) def test_all_cmds(command, mock_commands, mock_store_dir): > main.main((command,)) tests/main_test.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/main.py:342: in main raise AssertionError( /usr/lib64/python3.8/contextlib.py:131: in __exit__ self.gen.throw(type, value, traceback) pre_commit/error_handler.py:80: in error_handler _log_and_exit(msg, e, traceback.format_exc()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'An error has occurred' exc = FatalError('git failed. Is it installed, and are you in a Git repository directory?') formatted = 'Traceback (most recent call last):\n File "/builddir/build/BUILD/pre-commit-1.20.0/pre_commit/main.py", line 125, in...Error(\npre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory?\n' def _log_and_exit(msg, exc, formatted): error_msg = b''.join(( five.to_bytes(msg), b': ', five.to_bytes(type(exc).__name__), b': ', _to_bytes(exc), )) output.write_line(error_msg) store = Store() log_path = os.path.join(store.directory, 'pre-commit.log') output.write_line('Check the log at {}'.format(log_path)) with open(log_path, 'wb') as log: def _log_line(*s): # type: (*str) -> None output.write_line(*s, stream=log) _log_line('### version information') _log_line() _log_line('```') _log_line('pre-commit version: {}'.format(C.VERSION)) _log_line('sys.version:') for line in sys.version.splitlines(): _log_line(' {}'.format(line)) _log_line('sys.executable: {}'.format(sys.executable)) _log_line('os.name: {}'.format(os.name)) _log_line('sys.platform: {}'.format(sys.platform)) _log_line('```') _log_line() _log_line('### error information') _log_line() _log_line('```') _log_line(error_msg) _log_line('```') _log_line() _log_line('```') _log_line(formatted) _log_line('```') > raise SystemExit(1) E SystemExit: 1 pre_commit/error_handler.py:66: SystemExit ----------------------------- Captured stdout call ----------------------------- An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory? Check the log at /tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_autoupdate_0/0/pre-commit.log ____________________________ test_all_cmds[install] ____________________________ args = Namespace(allow_missing_config=False, color=False, command='install', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml', hook_types=['pre-commit'], install_hooks=False, overwrite=False) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: > os.chdir(git.get_root()) pre_commit/main.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def get_root(): > return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip() pre_commit/git.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('git', 'rev-parse', '--show-toplevel'), kwargs = {} def cmd_output(*cmd, **kwargs): > returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) pre_commit/util.py:154: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'rev-parse', '--show-toplevel') kwargs = {'env': None, 'stderr': -1, 'stdin': -1, 'stdout': -1}, retcode = 0 returncode = 128, stdout_b = b'' stderr_b = b'fatal: not a git repository (or any of the parent directories): .git\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'rev-parse', '--show-toplevel') E Return code: 128 E Expected return code: 0 E Output: (none) E Errors: E fatal: not a git repository (or any of the parent directories): .git pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: @contextlib.contextmanager def error_handler(): try: > yield pre_commit/error_handler.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ argv = ['install'] def main(argv=None): argv = argv if argv is not None else sys.argv[1:] argv = [five.to_text(arg) for arg in argv] parser = argparse.ArgumentParser() # https://stackoverflow.com/a/8521644/812183 parser.add_argument( '-V', '--version', action='version', version='%(prog)s {}'.format(C.VERSION), ) subparsers = parser.add_subparsers(dest='command') autoupdate_parser = subparsers.add_parser( 'autoupdate', help="Auto-update pre-commit config to the latest repos' versions.", ) _add_color_option(autoupdate_parser) _add_config_option(autoupdate_parser) autoupdate_parser.add_argument( '--tags-only', action='store_true', help='LEGACY: for compatibility', ) autoupdate_parser.add_argument( '--bleeding-edge', action='store_true', help=( 'Update to the bleeding edge of `master` instead of the latest ' 'tagged version (the default behavior).' ), ) autoupdate_parser.add_argument( '--repo', dest='repos', action='append', metavar='REPO', help='Only update this repository -- may be specified multiple times.', ) clean_parser = subparsers.add_parser( 'clean', help='Clean out pre-commit files.', ) _add_color_option(clean_parser) _add_config_option(clean_parser) gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.') _add_color_option(gc_parser) _add_config_option(gc_parser) init_templatedir_parser = subparsers.add_parser( 'init-templatedir', help=( 'Install hook script in a directory intended for use with ' '`git config init.templateDir`.' ), ) _add_color_option(init_templatedir_parser) _add_config_option(init_templatedir_parser) init_templatedir_parser.add_argument( 'directory', help='The directory in which to write the hook script.', ) _add_hook_type_option(init_templatedir_parser) install_parser = subparsers.add_parser( 'install', help='Install the pre-commit script.', ) _add_color_option(install_parser) _add_config_option(install_parser) install_parser.add_argument( '-f', '--overwrite', action='store_true', help='Overwrite existing hooks / remove migration mode.', ) install_parser.add_argument( '--install-hooks', action='store_true', help=( 'Whether to install hook environments for all environments ' 'in the config file.' ), ) _add_hook_type_option(install_parser) install_parser.add_argument( '--allow-missing-config', action='store_true', default=False, help=( 'Whether to allow a missing `pre-commit` configuration file ' 'or exit with a failure code.' ), ) install_hooks_parser = subparsers.add_parser( 'install-hooks', help=( 'Install hook environments for all environments in the config ' 'file. You may find `pre-commit install --install-hooks` more ' 'useful.' ), ) _add_color_option(install_hooks_parser) _add_config_option(install_hooks_parser) migrate_config_parser = subparsers.add_parser( 'migrate-config', help='Migrate list configuration to new map configuration.', ) _add_color_option(migrate_config_parser) _add_config_option(migrate_config_parser) run_parser = subparsers.add_parser('run', help='Run hooks.') _add_color_option(run_parser) _add_config_option(run_parser) _add_run_options(run_parser) sample_config_parser = subparsers.add_parser( 'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE), ) _add_color_option(sample_config_parser) _add_config_option(sample_config_parser) try_repo_parser = subparsers.add_parser( 'try-repo', help='Try the hooks in a repository, useful for developing new hooks.', ) _add_color_option(try_repo_parser) _add_config_option(try_repo_parser) try_repo_parser.add_argument( 'repo', help='Repository to source hooks from.', ) try_repo_parser.add_argument( '--ref', '--rev', help=( 'Manually select a rev to run against, otherwise the `HEAD` ' 'revision will be used.' ), ) _add_run_options(try_repo_parser) uninstall_parser = subparsers.add_parser( 'uninstall', help='Uninstall the pre-commit script.', ) _add_color_option(uninstall_parser) _add_config_option(uninstall_parser) _add_hook_type_option(uninstall_parser) help = subparsers.add_parser( 'help', help='Show help for a specific command.', ) help.add_argument('help_cmd', nargs='?', help='Command to show help for.') # argparse doesn't really provide a way to use a `default` subparser if len(argv) == 0: argv = ['run'] args = parser.parse_args(argv) if args.command == 'help' and args.help_cmd: parser.parse_args([args.help_cmd, '--help']) elif args.command == 'help': parser.parse_args(['--help']) with error_handler(), logging_handler(args.color): if args.command not in COMMANDS_NO_GIT: > _adjust_args_and_chdir(args) pre_commit/main.py:294: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = Namespace(allow_missing_config=False, color=False, command='install', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml', hook_types=['pre-commit'], install_hooks=False, overwrite=False) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: os.chdir(git.get_root()) except CalledProcessError: > raise FatalError( 'git failed. Is it installed, and are you in a Git repository ' 'directory?', ) E pre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory? pre_commit/main.py:127: FatalError During handling of the above exception, another exception occurred: command = 'install' mock_commands = auto_namedtuple(autoupdate=, clean=, uninstall=) mock_store_dir = '/tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_install_0/0' @pytest.mark.parametrize('command', CMDS) def test_all_cmds(command, mock_commands, mock_store_dir): > main.main((command,)) tests/main_test.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/main.py:342: in main raise AssertionError( /usr/lib64/python3.8/contextlib.py:131: in __exit__ self.gen.throw(type, value, traceback) pre_commit/error_handler.py:80: in error_handler _log_and_exit(msg, e, traceback.format_exc()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'An error has occurred' exc = FatalError('git failed. Is it installed, and are you in a Git repository directory?') formatted = 'Traceback (most recent call last):\n File "/builddir/build/BUILD/pre-commit-1.20.0/pre_commit/main.py", line 125, in...Error(\npre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory?\n' def _log_and_exit(msg, exc, formatted): error_msg = b''.join(( five.to_bytes(msg), b': ', five.to_bytes(type(exc).__name__), b': ', _to_bytes(exc), )) output.write_line(error_msg) store = Store() log_path = os.path.join(store.directory, 'pre-commit.log') output.write_line('Check the log at {}'.format(log_path)) with open(log_path, 'wb') as log: def _log_line(*s): # type: (*str) -> None output.write_line(*s, stream=log) _log_line('### version information') _log_line() _log_line('```') _log_line('pre-commit version: {}'.format(C.VERSION)) _log_line('sys.version:') for line in sys.version.splitlines(): _log_line(' {}'.format(line)) _log_line('sys.executable: {}'.format(sys.executable)) _log_line('os.name: {}'.format(os.name)) _log_line('sys.platform: {}'.format(sys.platform)) _log_line('```') _log_line() _log_line('### error information') _log_line() _log_line('```') _log_line(error_msg) _log_line('```') _log_line() _log_line('```') _log_line(formatted) _log_line('```') > raise SystemExit(1) E SystemExit: 1 pre_commit/error_handler.py:66: SystemExit ----------------------------- Captured stdout call ----------------------------- An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory? Check the log at /tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_install_0/0/pre-commit.log _________________________ test_all_cmds[install-hooks] _________________________ args = Namespace(color=False, command='install-hooks', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml') def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: > os.chdir(git.get_root()) pre_commit/main.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def get_root(): > return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip() pre_commit/git.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('git', 'rev-parse', '--show-toplevel'), kwargs = {} def cmd_output(*cmd, **kwargs): > returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) pre_commit/util.py:154: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'rev-parse', '--show-toplevel') kwargs = {'env': None, 'stderr': -1, 'stdin': -1, 'stdout': -1}, retcode = 0 returncode = 128, stdout_b = b'' stderr_b = b'fatal: not a git repository (or any of the parent directories): .git\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'rev-parse', '--show-toplevel') E Return code: 128 E Expected return code: 0 E Output: (none) E Errors: E fatal: not a git repository (or any of the parent directories): .git pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: @contextlib.contextmanager def error_handler(): try: > yield pre_commit/error_handler.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ argv = ['install-hooks'] def main(argv=None): argv = argv if argv is not None else sys.argv[1:] argv = [five.to_text(arg) for arg in argv] parser = argparse.ArgumentParser() # https://stackoverflow.com/a/8521644/812183 parser.add_argument( '-V', '--version', action='version', version='%(prog)s {}'.format(C.VERSION), ) subparsers = parser.add_subparsers(dest='command') autoupdate_parser = subparsers.add_parser( 'autoupdate', help="Auto-update pre-commit config to the latest repos' versions.", ) _add_color_option(autoupdate_parser) _add_config_option(autoupdate_parser) autoupdate_parser.add_argument( '--tags-only', action='store_true', help='LEGACY: for compatibility', ) autoupdate_parser.add_argument( '--bleeding-edge', action='store_true', help=( 'Update to the bleeding edge of `master` instead of the latest ' 'tagged version (the default behavior).' ), ) autoupdate_parser.add_argument( '--repo', dest='repos', action='append', metavar='REPO', help='Only update this repository -- may be specified multiple times.', ) clean_parser = subparsers.add_parser( 'clean', help='Clean out pre-commit files.', ) _add_color_option(clean_parser) _add_config_option(clean_parser) gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.') _add_color_option(gc_parser) _add_config_option(gc_parser) init_templatedir_parser = subparsers.add_parser( 'init-templatedir', help=( 'Install hook script in a directory intended for use with ' '`git config init.templateDir`.' ), ) _add_color_option(init_templatedir_parser) _add_config_option(init_templatedir_parser) init_templatedir_parser.add_argument( 'directory', help='The directory in which to write the hook script.', ) _add_hook_type_option(init_templatedir_parser) install_parser = subparsers.add_parser( 'install', help='Install the pre-commit script.', ) _add_color_option(install_parser) _add_config_option(install_parser) install_parser.add_argument( '-f', '--overwrite', action='store_true', help='Overwrite existing hooks / remove migration mode.', ) install_parser.add_argument( '--install-hooks', action='store_true', help=( 'Whether to install hook environments for all environments ' 'in the config file.' ), ) _add_hook_type_option(install_parser) install_parser.add_argument( '--allow-missing-config', action='store_true', default=False, help=( 'Whether to allow a missing `pre-commit` configuration file ' 'or exit with a failure code.' ), ) install_hooks_parser = subparsers.add_parser( 'install-hooks', help=( 'Install hook environments for all environments in the config ' 'file. You may find `pre-commit install --install-hooks` more ' 'useful.' ), ) _add_color_option(install_hooks_parser) _add_config_option(install_hooks_parser) migrate_config_parser = subparsers.add_parser( 'migrate-config', help='Migrate list configuration to new map configuration.', ) _add_color_option(migrate_config_parser) _add_config_option(migrate_config_parser) run_parser = subparsers.add_parser('run', help='Run hooks.') _add_color_option(run_parser) _add_config_option(run_parser) _add_run_options(run_parser) sample_config_parser = subparsers.add_parser( 'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE), ) _add_color_option(sample_config_parser) _add_config_option(sample_config_parser) try_repo_parser = subparsers.add_parser( 'try-repo', help='Try the hooks in a repository, useful for developing new hooks.', ) _add_color_option(try_repo_parser) _add_config_option(try_repo_parser) try_repo_parser.add_argument( 'repo', help='Repository to source hooks from.', ) try_repo_parser.add_argument( '--ref', '--rev', help=( 'Manually select a rev to run against, otherwise the `HEAD` ' 'revision will be used.' ), ) _add_run_options(try_repo_parser) uninstall_parser = subparsers.add_parser( 'uninstall', help='Uninstall the pre-commit script.', ) _add_color_option(uninstall_parser) _add_config_option(uninstall_parser) _add_hook_type_option(uninstall_parser) help = subparsers.add_parser( 'help', help='Show help for a specific command.', ) help.add_argument('help_cmd', nargs='?', help='Command to show help for.') # argparse doesn't really provide a way to use a `default` subparser if len(argv) == 0: argv = ['run'] args = parser.parse_args(argv) if args.command == 'help' and args.help_cmd: parser.parse_args([args.help_cmd, '--help']) elif args.command == 'help': parser.parse_args(['--help']) with error_handler(), logging_handler(args.color): if args.command not in COMMANDS_NO_GIT: > _adjust_args_and_chdir(args) pre_commit/main.py:294: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = Namespace(color=False, command='install-hooks', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml') def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: os.chdir(git.get_root()) except CalledProcessError: > raise FatalError( 'git failed. Is it installed, and are you in a Git repository ' 'directory?', ) E pre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory? pre_commit/main.py:127: FatalError During handling of the above exception, another exception occurred: command = 'install-hooks' mock_commands = auto_namedtuple(autoupdate=, clean=, uninstall=) mock_store_dir = '/tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_install_hooks_0/0' @pytest.mark.parametrize('command', CMDS) def test_all_cmds(command, mock_commands, mock_store_dir): > main.main((command,)) tests/main_test.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/main.py:342: in main raise AssertionError( /usr/lib64/python3.8/contextlib.py:131: in __exit__ self.gen.throw(type, value, traceback) pre_commit/error_handler.py:80: in error_handler _log_and_exit(msg, e, traceback.format_exc()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'An error has occurred' exc = FatalError('git failed. Is it installed, and are you in a Git repository directory?') formatted = 'Traceback (most recent call last):\n File "/builddir/build/BUILD/pre-commit-1.20.0/pre_commit/main.py", line 125, in...Error(\npre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory?\n' def _log_and_exit(msg, exc, formatted): error_msg = b''.join(( five.to_bytes(msg), b': ', five.to_bytes(type(exc).__name__), b': ', _to_bytes(exc), )) output.write_line(error_msg) store = Store() log_path = os.path.join(store.directory, 'pre-commit.log') output.write_line('Check the log at {}'.format(log_path)) with open(log_path, 'wb') as log: def _log_line(*s): # type: (*str) -> None output.write_line(*s, stream=log) _log_line('### version information') _log_line() _log_line('```') _log_line('pre-commit version: {}'.format(C.VERSION)) _log_line('sys.version:') for line in sys.version.splitlines(): _log_line(' {}'.format(line)) _log_line('sys.executable: {}'.format(sys.executable)) _log_line('os.name: {}'.format(os.name)) _log_line('sys.platform: {}'.format(sys.platform)) _log_line('```') _log_line() _log_line('### error information') _log_line() _log_line('```') _log_line(error_msg) _log_line('```') _log_line() _log_line('```') _log_line(formatted) _log_line('```') > raise SystemExit(1) E SystemExit: 1 pre_commit/error_handler.py:66: SystemExit ----------------------------- Captured stdout call ----------------------------- An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory? Check the log at /tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_install_hooks_0/0/pre-commit.log ________________________ test_all_cmds[migrate-config] _________________________ args = Namespace(color=False, command='migrate-config', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml') def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: > os.chdir(git.get_root()) pre_commit/main.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def get_root(): > return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip() pre_commit/git.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('git', 'rev-parse', '--show-toplevel'), kwargs = {} def cmd_output(*cmd, **kwargs): > returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) pre_commit/util.py:154: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'rev-parse', '--show-toplevel') kwargs = {'env': None, 'stderr': -1, 'stdin': -1, 'stdout': -1}, retcode = 0 returncode = 128, stdout_b = b'' stderr_b = b'fatal: not a git repository (or any of the parent directories): .git\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'rev-parse', '--show-toplevel') E Return code: 128 E Expected return code: 0 E Output: (none) E Errors: E fatal: not a git repository (or any of the parent directories): .git pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: @contextlib.contextmanager def error_handler(): try: > yield pre_commit/error_handler.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ argv = ['migrate-config'] def main(argv=None): argv = argv if argv is not None else sys.argv[1:] argv = [five.to_text(arg) for arg in argv] parser = argparse.ArgumentParser() # https://stackoverflow.com/a/8521644/812183 parser.add_argument( '-V', '--version', action='version', version='%(prog)s {}'.format(C.VERSION), ) subparsers = parser.add_subparsers(dest='command') autoupdate_parser = subparsers.add_parser( 'autoupdate', help="Auto-update pre-commit config to the latest repos' versions.", ) _add_color_option(autoupdate_parser) _add_config_option(autoupdate_parser) autoupdate_parser.add_argument( '--tags-only', action='store_true', help='LEGACY: for compatibility', ) autoupdate_parser.add_argument( '--bleeding-edge', action='store_true', help=( 'Update to the bleeding edge of `master` instead of the latest ' 'tagged version (the default behavior).' ), ) autoupdate_parser.add_argument( '--repo', dest='repos', action='append', metavar='REPO', help='Only update this repository -- may be specified multiple times.', ) clean_parser = subparsers.add_parser( 'clean', help='Clean out pre-commit files.', ) _add_color_option(clean_parser) _add_config_option(clean_parser) gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.') _add_color_option(gc_parser) _add_config_option(gc_parser) init_templatedir_parser = subparsers.add_parser( 'init-templatedir', help=( 'Install hook script in a directory intended for use with ' '`git config init.templateDir`.' ), ) _add_color_option(init_templatedir_parser) _add_config_option(init_templatedir_parser) init_templatedir_parser.add_argument( 'directory', help='The directory in which to write the hook script.', ) _add_hook_type_option(init_templatedir_parser) install_parser = subparsers.add_parser( 'install', help='Install the pre-commit script.', ) _add_color_option(install_parser) _add_config_option(install_parser) install_parser.add_argument( '-f', '--overwrite', action='store_true', help='Overwrite existing hooks / remove migration mode.', ) install_parser.add_argument( '--install-hooks', action='store_true', help=( 'Whether to install hook environments for all environments ' 'in the config file.' ), ) _add_hook_type_option(install_parser) install_parser.add_argument( '--allow-missing-config', action='store_true', default=False, help=( 'Whether to allow a missing `pre-commit` configuration file ' 'or exit with a failure code.' ), ) install_hooks_parser = subparsers.add_parser( 'install-hooks', help=( 'Install hook environments for all environments in the config ' 'file. You may find `pre-commit install --install-hooks` more ' 'useful.' ), ) _add_color_option(install_hooks_parser) _add_config_option(install_hooks_parser) migrate_config_parser = subparsers.add_parser( 'migrate-config', help='Migrate list configuration to new map configuration.', ) _add_color_option(migrate_config_parser) _add_config_option(migrate_config_parser) run_parser = subparsers.add_parser('run', help='Run hooks.') _add_color_option(run_parser) _add_config_option(run_parser) _add_run_options(run_parser) sample_config_parser = subparsers.add_parser( 'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE), ) _add_color_option(sample_config_parser) _add_config_option(sample_config_parser) try_repo_parser = subparsers.add_parser( 'try-repo', help='Try the hooks in a repository, useful for developing new hooks.', ) _add_color_option(try_repo_parser) _add_config_option(try_repo_parser) try_repo_parser.add_argument( 'repo', help='Repository to source hooks from.', ) try_repo_parser.add_argument( '--ref', '--rev', help=( 'Manually select a rev to run against, otherwise the `HEAD` ' 'revision will be used.' ), ) _add_run_options(try_repo_parser) uninstall_parser = subparsers.add_parser( 'uninstall', help='Uninstall the pre-commit script.', ) _add_color_option(uninstall_parser) _add_config_option(uninstall_parser) _add_hook_type_option(uninstall_parser) help = subparsers.add_parser( 'help', help='Show help for a specific command.', ) help.add_argument('help_cmd', nargs='?', help='Command to show help for.') # argparse doesn't really provide a way to use a `default` subparser if len(argv) == 0: argv = ['run'] args = parser.parse_args(argv) if args.command == 'help' and args.help_cmd: parser.parse_args([args.help_cmd, '--help']) elif args.command == 'help': parser.parse_args(['--help']) with error_handler(), logging_handler(args.color): if args.command not in COMMANDS_NO_GIT: > _adjust_args_and_chdir(args) pre_commit/main.py:294: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = Namespace(color=False, command='migrate-config', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml') def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: os.chdir(git.get_root()) except CalledProcessError: > raise FatalError( 'git failed. Is it installed, and are you in a Git repository ' 'directory?', ) E pre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory? pre_commit/main.py:127: FatalError During handling of the above exception, another exception occurred: command = 'migrate-config' mock_commands = auto_namedtuple(autoupdate=, clean=, uninstall=) mock_store_dir = '/tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_migrate_config_0/0' @pytest.mark.parametrize('command', CMDS) def test_all_cmds(command, mock_commands, mock_store_dir): > main.main((command,)) tests/main_test.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/main.py:342: in main raise AssertionError( /usr/lib64/python3.8/contextlib.py:131: in __exit__ self.gen.throw(type, value, traceback) pre_commit/error_handler.py:80: in error_handler _log_and_exit(msg, e, traceback.format_exc()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'An error has occurred' exc = FatalError('git failed. Is it installed, and are you in a Git repository directory?') formatted = 'Traceback (most recent call last):\n File "/builddir/build/BUILD/pre-commit-1.20.0/pre_commit/main.py", line 125, in...Error(\npre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory?\n' def _log_and_exit(msg, exc, formatted): error_msg = b''.join(( five.to_bytes(msg), b': ', five.to_bytes(type(exc).__name__), b': ', _to_bytes(exc), )) output.write_line(error_msg) store = Store() log_path = os.path.join(store.directory, 'pre-commit.log') output.write_line('Check the log at {}'.format(log_path)) with open(log_path, 'wb') as log: def _log_line(*s): # type: (*str) -> None output.write_line(*s, stream=log) _log_line('### version information') _log_line() _log_line('```') _log_line('pre-commit version: {}'.format(C.VERSION)) _log_line('sys.version:') for line in sys.version.splitlines(): _log_line(' {}'.format(line)) _log_line('sys.executable: {}'.format(sys.executable)) _log_line('os.name: {}'.format(os.name)) _log_line('sys.platform: {}'.format(sys.platform)) _log_line('```') _log_line() _log_line('### error information') _log_line() _log_line('```') _log_line(error_msg) _log_line('```') _log_line() _log_line('```') _log_line(formatted) _log_line('```') > raise SystemExit(1) E SystemExit: 1 pre_commit/error_handler.py:66: SystemExit ----------------------------- Captured stdout call ----------------------------- An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory? Check the log at /tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_migrate_config_0/0/pre-commit.log ______________________________ test_all_cmds[run] ______________________________ args = Namespace(all_files=False, color=False, command='run', commit_msg_filename=None, config='/builddir/build/BUILD/pre-com...g.yaml', files=[], hook=None, hook_stage='commit', origin=None, show_diff_on_failure=False, source=None, verbose=False) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: > os.chdir(git.get_root()) pre_commit/main.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def get_root(): > return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip() pre_commit/git.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('git', 'rev-parse', '--show-toplevel'), kwargs = {} def cmd_output(*cmd, **kwargs): > returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) pre_commit/util.py:154: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'rev-parse', '--show-toplevel') kwargs = {'env': None, 'stderr': -1, 'stdin': -1, 'stdout': -1}, retcode = 0 returncode = 128, stdout_b = b'' stderr_b = b'fatal: not a git repository (or any of the parent directories): .git\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'rev-parse', '--show-toplevel') E Return code: 128 E Expected return code: 0 E Output: (none) E Errors: E fatal: not a git repository (or any of the parent directories): .git pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: @contextlib.contextmanager def error_handler(): try: > yield pre_commit/error_handler.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ argv = ['run'] def main(argv=None): argv = argv if argv is not None else sys.argv[1:] argv = [five.to_text(arg) for arg in argv] parser = argparse.ArgumentParser() # https://stackoverflow.com/a/8521644/812183 parser.add_argument( '-V', '--version', action='version', version='%(prog)s {}'.format(C.VERSION), ) subparsers = parser.add_subparsers(dest='command') autoupdate_parser = subparsers.add_parser( 'autoupdate', help="Auto-update pre-commit config to the latest repos' versions.", ) _add_color_option(autoupdate_parser) _add_config_option(autoupdate_parser) autoupdate_parser.add_argument( '--tags-only', action='store_true', help='LEGACY: for compatibility', ) autoupdate_parser.add_argument( '--bleeding-edge', action='store_true', help=( 'Update to the bleeding edge of `master` instead of the latest ' 'tagged version (the default behavior).' ), ) autoupdate_parser.add_argument( '--repo', dest='repos', action='append', metavar='REPO', help='Only update this repository -- may be specified multiple times.', ) clean_parser = subparsers.add_parser( 'clean', help='Clean out pre-commit files.', ) _add_color_option(clean_parser) _add_config_option(clean_parser) gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.') _add_color_option(gc_parser) _add_config_option(gc_parser) init_templatedir_parser = subparsers.add_parser( 'init-templatedir', help=( 'Install hook script in a directory intended for use with ' '`git config init.templateDir`.' ), ) _add_color_option(init_templatedir_parser) _add_config_option(init_templatedir_parser) init_templatedir_parser.add_argument( 'directory', help='The directory in which to write the hook script.', ) _add_hook_type_option(init_templatedir_parser) install_parser = subparsers.add_parser( 'install', help='Install the pre-commit script.', ) _add_color_option(install_parser) _add_config_option(install_parser) install_parser.add_argument( '-f', '--overwrite', action='store_true', help='Overwrite existing hooks / remove migration mode.', ) install_parser.add_argument( '--install-hooks', action='store_true', help=( 'Whether to install hook environments for all environments ' 'in the config file.' ), ) _add_hook_type_option(install_parser) install_parser.add_argument( '--allow-missing-config', action='store_true', default=False, help=( 'Whether to allow a missing `pre-commit` configuration file ' 'or exit with a failure code.' ), ) install_hooks_parser = subparsers.add_parser( 'install-hooks', help=( 'Install hook environments for all environments in the config ' 'file. You may find `pre-commit install --install-hooks` more ' 'useful.' ), ) _add_color_option(install_hooks_parser) _add_config_option(install_hooks_parser) migrate_config_parser = subparsers.add_parser( 'migrate-config', help='Migrate list configuration to new map configuration.', ) _add_color_option(migrate_config_parser) _add_config_option(migrate_config_parser) run_parser = subparsers.add_parser('run', help='Run hooks.') _add_color_option(run_parser) _add_config_option(run_parser) _add_run_options(run_parser) sample_config_parser = subparsers.add_parser( 'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE), ) _add_color_option(sample_config_parser) _add_config_option(sample_config_parser) try_repo_parser = subparsers.add_parser( 'try-repo', help='Try the hooks in a repository, useful for developing new hooks.', ) _add_color_option(try_repo_parser) _add_config_option(try_repo_parser) try_repo_parser.add_argument( 'repo', help='Repository to source hooks from.', ) try_repo_parser.add_argument( '--ref', '--rev', help=( 'Manually select a rev to run against, otherwise the `HEAD` ' 'revision will be used.' ), ) _add_run_options(try_repo_parser) uninstall_parser = subparsers.add_parser( 'uninstall', help='Uninstall the pre-commit script.', ) _add_color_option(uninstall_parser) _add_config_option(uninstall_parser) _add_hook_type_option(uninstall_parser) help = subparsers.add_parser( 'help', help='Show help for a specific command.', ) help.add_argument('help_cmd', nargs='?', help='Command to show help for.') # argparse doesn't really provide a way to use a `default` subparser if len(argv) == 0: argv = ['run'] args = parser.parse_args(argv) if args.command == 'help' and args.help_cmd: parser.parse_args([args.help_cmd, '--help']) elif args.command == 'help': parser.parse_args(['--help']) with error_handler(), logging_handler(args.color): if args.command not in COMMANDS_NO_GIT: > _adjust_args_and_chdir(args) pre_commit/main.py:294: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = Namespace(all_files=False, color=False, command='run', commit_msg_filename=None, config='/builddir/build/BUILD/pre-com...g.yaml', files=[], hook=None, hook_stage='commit', origin=None, show_diff_on_failure=False, source=None, verbose=False) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: os.chdir(git.get_root()) except CalledProcessError: > raise FatalError( 'git failed. Is it installed, and are you in a Git repository ' 'directory?', ) E pre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory? pre_commit/main.py:127: FatalError During handling of the above exception, another exception occurred: command = 'run' mock_commands = auto_namedtuple(autoupdate=, clean=, uninstall=) mock_store_dir = '/tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_run_0/0' @pytest.mark.parametrize('command', CMDS) def test_all_cmds(command, mock_commands, mock_store_dir): > main.main((command,)) tests/main_test.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/main.py:342: in main raise AssertionError( /usr/lib64/python3.8/contextlib.py:131: in __exit__ self.gen.throw(type, value, traceback) pre_commit/error_handler.py:80: in error_handler _log_and_exit(msg, e, traceback.format_exc()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'An error has occurred' exc = FatalError('git failed. Is it installed, and are you in a Git repository directory?') formatted = 'Traceback (most recent call last):\n File "/builddir/build/BUILD/pre-commit-1.20.0/pre_commit/main.py", line 125, in...Error(\npre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory?\n' def _log_and_exit(msg, exc, formatted): error_msg = b''.join(( five.to_bytes(msg), b': ', five.to_bytes(type(exc).__name__), b': ', _to_bytes(exc), )) output.write_line(error_msg) store = Store() log_path = os.path.join(store.directory, 'pre-commit.log') output.write_line('Check the log at {}'.format(log_path)) with open(log_path, 'wb') as log: def _log_line(*s): # type: (*str) -> None output.write_line(*s, stream=log) _log_line('### version information') _log_line() _log_line('```') _log_line('pre-commit version: {}'.format(C.VERSION)) _log_line('sys.version:') for line in sys.version.splitlines(): _log_line(' {}'.format(line)) _log_line('sys.executable: {}'.format(sys.executable)) _log_line('os.name: {}'.format(os.name)) _log_line('sys.platform: {}'.format(sys.platform)) _log_line('```') _log_line() _log_line('### error information') _log_line() _log_line('```') _log_line(error_msg) _log_line('```') _log_line() _log_line('```') _log_line(formatted) _log_line('```') > raise SystemExit(1) E SystemExit: 1 pre_commit/error_handler.py:66: SystemExit ----------------------------- Captured stdout call ----------------------------- An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory? Check the log at /tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_run_0/0/pre-commit.log ___________________________ test_all_cmds[uninstall] ___________________________ args = Namespace(color=False, command='uninstall', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml', hook_types=['pre-commit']) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: > os.chdir(git.get_root()) pre_commit/main.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def get_root(): > return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip() pre_commit/git.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('git', 'rev-parse', '--show-toplevel'), kwargs = {} def cmd_output(*cmd, **kwargs): > returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) pre_commit/util.py:154: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'rev-parse', '--show-toplevel') kwargs = {'env': None, 'stderr': -1, 'stdin': -1, 'stdout': -1}, retcode = 0 returncode = 128, stdout_b = b'' stderr_b = b'fatal: not a git repository (or any of the parent directories): .git\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'rev-parse', '--show-toplevel') E Return code: 128 E Expected return code: 0 E Output: (none) E Errors: E fatal: not a git repository (or any of the parent directories): .git pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: @contextlib.contextmanager def error_handler(): try: > yield pre_commit/error_handler.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ argv = ['uninstall'] def main(argv=None): argv = argv if argv is not None else sys.argv[1:] argv = [five.to_text(arg) for arg in argv] parser = argparse.ArgumentParser() # https://stackoverflow.com/a/8521644/812183 parser.add_argument( '-V', '--version', action='version', version='%(prog)s {}'.format(C.VERSION), ) subparsers = parser.add_subparsers(dest='command') autoupdate_parser = subparsers.add_parser( 'autoupdate', help="Auto-update pre-commit config to the latest repos' versions.", ) _add_color_option(autoupdate_parser) _add_config_option(autoupdate_parser) autoupdate_parser.add_argument( '--tags-only', action='store_true', help='LEGACY: for compatibility', ) autoupdate_parser.add_argument( '--bleeding-edge', action='store_true', help=( 'Update to the bleeding edge of `master` instead of the latest ' 'tagged version (the default behavior).' ), ) autoupdate_parser.add_argument( '--repo', dest='repos', action='append', metavar='REPO', help='Only update this repository -- may be specified multiple times.', ) clean_parser = subparsers.add_parser( 'clean', help='Clean out pre-commit files.', ) _add_color_option(clean_parser) _add_config_option(clean_parser) gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.') _add_color_option(gc_parser) _add_config_option(gc_parser) init_templatedir_parser = subparsers.add_parser( 'init-templatedir', help=( 'Install hook script in a directory intended for use with ' '`git config init.templateDir`.' ), ) _add_color_option(init_templatedir_parser) _add_config_option(init_templatedir_parser) init_templatedir_parser.add_argument( 'directory', help='The directory in which to write the hook script.', ) _add_hook_type_option(init_templatedir_parser) install_parser = subparsers.add_parser( 'install', help='Install the pre-commit script.', ) _add_color_option(install_parser) _add_config_option(install_parser) install_parser.add_argument( '-f', '--overwrite', action='store_true', help='Overwrite existing hooks / remove migration mode.', ) install_parser.add_argument( '--install-hooks', action='store_true', help=( 'Whether to install hook environments for all environments ' 'in the config file.' ), ) _add_hook_type_option(install_parser) install_parser.add_argument( '--allow-missing-config', action='store_true', default=False, help=( 'Whether to allow a missing `pre-commit` configuration file ' 'or exit with a failure code.' ), ) install_hooks_parser = subparsers.add_parser( 'install-hooks', help=( 'Install hook environments for all environments in the config ' 'file. You may find `pre-commit install --install-hooks` more ' 'useful.' ), ) _add_color_option(install_hooks_parser) _add_config_option(install_hooks_parser) migrate_config_parser = subparsers.add_parser( 'migrate-config', help='Migrate list configuration to new map configuration.', ) _add_color_option(migrate_config_parser) _add_config_option(migrate_config_parser) run_parser = subparsers.add_parser('run', help='Run hooks.') _add_color_option(run_parser) _add_config_option(run_parser) _add_run_options(run_parser) sample_config_parser = subparsers.add_parser( 'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE), ) _add_color_option(sample_config_parser) _add_config_option(sample_config_parser) try_repo_parser = subparsers.add_parser( 'try-repo', help='Try the hooks in a repository, useful for developing new hooks.', ) _add_color_option(try_repo_parser) _add_config_option(try_repo_parser) try_repo_parser.add_argument( 'repo', help='Repository to source hooks from.', ) try_repo_parser.add_argument( '--ref', '--rev', help=( 'Manually select a rev to run against, otherwise the `HEAD` ' 'revision will be used.' ), ) _add_run_options(try_repo_parser) uninstall_parser = subparsers.add_parser( 'uninstall', help='Uninstall the pre-commit script.', ) _add_color_option(uninstall_parser) _add_config_option(uninstall_parser) _add_hook_type_option(uninstall_parser) help = subparsers.add_parser( 'help', help='Show help for a specific command.', ) help.add_argument('help_cmd', nargs='?', help='Command to show help for.') # argparse doesn't really provide a way to use a `default` subparser if len(argv) == 0: argv = ['run'] args = parser.parse_args(argv) if args.command == 'help' and args.help_cmd: parser.parse_args([args.help_cmd, '--help']) elif args.command == 'help': parser.parse_args(['--help']) with error_handler(), logging_handler(args.color): if args.command not in COMMANDS_NO_GIT: > _adjust_args_and_chdir(args) pre_commit/main.py:294: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = Namespace(color=False, command='uninstall', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml', hook_types=['pre-commit']) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: os.chdir(git.get_root()) except CalledProcessError: > raise FatalError( 'git failed. Is it installed, and are you in a Git repository ' 'directory?', ) E pre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory? pre_commit/main.py:127: FatalError During handling of the above exception, another exception occurred: command = 'uninstall' mock_commands = auto_namedtuple(autoupdate=, clean=, uninstall=) mock_store_dir = '/tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_uninstall_0/0' @pytest.mark.parametrize('command', CMDS) def test_all_cmds(command, mock_commands, mock_store_dir): > main.main((command,)) tests/main_test.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/main.py:342: in main raise AssertionError( /usr/lib64/python3.8/contextlib.py:131: in __exit__ self.gen.throw(type, value, traceback) pre_commit/error_handler.py:80: in error_handler _log_and_exit(msg, e, traceback.format_exc()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'An error has occurred' exc = FatalError('git failed. Is it installed, and are you in a Git repository directory?') formatted = 'Traceback (most recent call last):\n File "/builddir/build/BUILD/pre-commit-1.20.0/pre_commit/main.py", line 125, in...Error(\npre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory?\n' def _log_and_exit(msg, exc, formatted): error_msg = b''.join(( five.to_bytes(msg), b': ', five.to_bytes(type(exc).__name__), b': ', _to_bytes(exc), )) output.write_line(error_msg) store = Store() log_path = os.path.join(store.directory, 'pre-commit.log') output.write_line('Check the log at {}'.format(log_path)) with open(log_path, 'wb') as log: def _log_line(*s): # type: (*str) -> None output.write_line(*s, stream=log) _log_line('### version information') _log_line() _log_line('```') _log_line('pre-commit version: {}'.format(C.VERSION)) _log_line('sys.version:') for line in sys.version.splitlines(): _log_line(' {}'.format(line)) _log_line('sys.executable: {}'.format(sys.executable)) _log_line('os.name: {}'.format(os.name)) _log_line('sys.platform: {}'.format(sys.platform)) _log_line('```') _log_line() _log_line('### error information') _log_line() _log_line('```') _log_line(error_msg) _log_line('```') _log_line() _log_line('```') _log_line(formatted) _log_line('```') > raise SystemExit(1) E SystemExit: 1 pre_commit/error_handler.py:66: SystemExit ----------------------------- Captured stdout call ----------------------------- An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory? Check the log at /tmp/pytest-of-mockbuild/pytest-2/test_all_cmds_uninstall_0/0/pre-commit.log ________________________________ test_try_repo _________________________________ args = Namespace(all_files=False, color=False, command='try-repo', commit_msg_filename=None, config='/builddir/build/BUILD/pr...None, ref=None, repo='/builddir/build/BUILD/pre-commit-1.20.0', show_diff_on_failure=False, source=None, verbose=False) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: > os.chdir(git.get_root()) pre_commit/main.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def get_root(): > return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip() pre_commit/git.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('git', 'rev-parse', '--show-toplevel'), kwargs = {} def cmd_output(*cmd, **kwargs): > returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) pre_commit/util.py:154: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'rev-parse', '--show-toplevel') kwargs = {'env': None, 'stderr': -1, 'stdin': -1, 'stdout': -1}, retcode = 0 returncode = 128, stdout_b = b'' stderr_b = b'fatal: not a git repository (or any of the parent directories): .git\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'rev-parse', '--show-toplevel') E Return code: 128 E Expected return code: 0 E Output: (none) E Errors: E fatal: not a git repository (or any of the parent directories): .git pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: @contextlib.contextmanager def error_handler(): try: > yield pre_commit/error_handler.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ argv = ['try-repo', '.'] def main(argv=None): argv = argv if argv is not None else sys.argv[1:] argv = [five.to_text(arg) for arg in argv] parser = argparse.ArgumentParser() # https://stackoverflow.com/a/8521644/812183 parser.add_argument( '-V', '--version', action='version', version='%(prog)s {}'.format(C.VERSION), ) subparsers = parser.add_subparsers(dest='command') autoupdate_parser = subparsers.add_parser( 'autoupdate', help="Auto-update pre-commit config to the latest repos' versions.", ) _add_color_option(autoupdate_parser) _add_config_option(autoupdate_parser) autoupdate_parser.add_argument( '--tags-only', action='store_true', help='LEGACY: for compatibility', ) autoupdate_parser.add_argument( '--bleeding-edge', action='store_true', help=( 'Update to the bleeding edge of `master` instead of the latest ' 'tagged version (the default behavior).' ), ) autoupdate_parser.add_argument( '--repo', dest='repos', action='append', metavar='REPO', help='Only update this repository -- may be specified multiple times.', ) clean_parser = subparsers.add_parser( 'clean', help='Clean out pre-commit files.', ) _add_color_option(clean_parser) _add_config_option(clean_parser) gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.') _add_color_option(gc_parser) _add_config_option(gc_parser) init_templatedir_parser = subparsers.add_parser( 'init-templatedir', help=( 'Install hook script in a directory intended for use with ' '`git config init.templateDir`.' ), ) _add_color_option(init_templatedir_parser) _add_config_option(init_templatedir_parser) init_templatedir_parser.add_argument( 'directory', help='The directory in which to write the hook script.', ) _add_hook_type_option(init_templatedir_parser) install_parser = subparsers.add_parser( 'install', help='Install the pre-commit script.', ) _add_color_option(install_parser) _add_config_option(install_parser) install_parser.add_argument( '-f', '--overwrite', action='store_true', help='Overwrite existing hooks / remove migration mode.', ) install_parser.add_argument( '--install-hooks', action='store_true', help=( 'Whether to install hook environments for all environments ' 'in the config file.' ), ) _add_hook_type_option(install_parser) install_parser.add_argument( '--allow-missing-config', action='store_true', default=False, help=( 'Whether to allow a missing `pre-commit` configuration file ' 'or exit with a failure code.' ), ) install_hooks_parser = subparsers.add_parser( 'install-hooks', help=( 'Install hook environments for all environments in the config ' 'file. You may find `pre-commit install --install-hooks` more ' 'useful.' ), ) _add_color_option(install_hooks_parser) _add_config_option(install_hooks_parser) migrate_config_parser = subparsers.add_parser( 'migrate-config', help='Migrate list configuration to new map configuration.', ) _add_color_option(migrate_config_parser) _add_config_option(migrate_config_parser) run_parser = subparsers.add_parser('run', help='Run hooks.') _add_color_option(run_parser) _add_config_option(run_parser) _add_run_options(run_parser) sample_config_parser = subparsers.add_parser( 'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE), ) _add_color_option(sample_config_parser) _add_config_option(sample_config_parser) try_repo_parser = subparsers.add_parser( 'try-repo', help='Try the hooks in a repository, useful for developing new hooks.', ) _add_color_option(try_repo_parser) _add_config_option(try_repo_parser) try_repo_parser.add_argument( 'repo', help='Repository to source hooks from.', ) try_repo_parser.add_argument( '--ref', '--rev', help=( 'Manually select a rev to run against, otherwise the `HEAD` ' 'revision will be used.' ), ) _add_run_options(try_repo_parser) uninstall_parser = subparsers.add_parser( 'uninstall', help='Uninstall the pre-commit script.', ) _add_color_option(uninstall_parser) _add_config_option(uninstall_parser) _add_hook_type_option(uninstall_parser) help = subparsers.add_parser( 'help', help='Show help for a specific command.', ) help.add_argument('help_cmd', nargs='?', help='Command to show help for.') # argparse doesn't really provide a way to use a `default` subparser if len(argv) == 0: argv = ['run'] args = parser.parse_args(argv) if args.command == 'help' and args.help_cmd: parser.parse_args([args.help_cmd, '--help']) elif args.command == 'help': parser.parse_args(['--help']) with error_handler(), logging_handler(args.color): if args.command not in COMMANDS_NO_GIT: > _adjust_args_and_chdir(args) pre_commit/main.py:294: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = Namespace(all_files=False, color=False, command='try-repo', commit_msg_filename=None, config='/builddir/build/BUILD/pr...None, ref=None, repo='/builddir/build/BUILD/pre-commit-1.20.0', show_diff_on_failure=False, source=None, verbose=False) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: os.chdir(git.get_root()) except CalledProcessError: > raise FatalError( 'git failed. Is it installed, and are you in a Git repository ' 'directory?', ) E pre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory? pre_commit/main.py:127: FatalError During handling of the above exception, another exception occurred: mock_store_dir = '/tmp/pytest-of-mockbuild/pytest-2/test_try_repo0/0' def test_try_repo(mock_store_dir): with mock.patch.object(main, 'try_repo') as patch: > main.main(('try-repo', '.')) tests/main_test.py:153: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/main.py:342: in main raise AssertionError( /usr/lib64/python3.8/contextlib.py:131: in __exit__ self.gen.throw(type, value, traceback) pre_commit/error_handler.py:80: in error_handler _log_and_exit(msg, e, traceback.format_exc()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'An error has occurred' exc = FatalError('git failed. Is it installed, and are you in a Git repository directory?') formatted = 'Traceback (most recent call last):\n File "/builddir/build/BUILD/pre-commit-1.20.0/pre_commit/main.py", line 125, in...Error(\npre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory?\n' def _log_and_exit(msg, exc, formatted): error_msg = b''.join(( five.to_bytes(msg), b': ', five.to_bytes(type(exc).__name__), b': ', _to_bytes(exc), )) output.write_line(error_msg) store = Store() log_path = os.path.join(store.directory, 'pre-commit.log') output.write_line('Check the log at {}'.format(log_path)) with open(log_path, 'wb') as log: def _log_line(*s): # type: (*str) -> None output.write_line(*s, stream=log) _log_line('### version information') _log_line() _log_line('```') _log_line('pre-commit version: {}'.format(C.VERSION)) _log_line('sys.version:') for line in sys.version.splitlines(): _log_line(' {}'.format(line)) _log_line('sys.executable: {}'.format(sys.executable)) _log_line('os.name: {}'.format(os.name)) _log_line('sys.platform: {}'.format(sys.platform)) _log_line('```') _log_line() _log_line('### error information') _log_line() _log_line('```') _log_line(error_msg) _log_line('```') _log_line() _log_line('```') _log_line(formatted) _log_line('```') > raise SystemExit(1) E SystemExit: 1 pre_commit/error_handler.py:66: SystemExit ----------------------------- Captured stdout call ----------------------------- An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory? Check the log at /tmp/pytest-of-mockbuild/pytest-2/test_try_repo0/0/pre-commit.log __________________________ test_warning_on_tags_only ___________________________ args = Namespace(bleeding_edge=False, color=False, command='autoupdate', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml', repos=None, tags_only=True) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: > os.chdir(git.get_root()) pre_commit/main.py:125: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def get_root(): > return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip() pre_commit/git.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('git', 'rev-parse', '--show-toplevel'), kwargs = {} def cmd_output(*cmd, **kwargs): > returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) pre_commit/util.py:154: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'rev-parse', '--show-toplevel') kwargs = {'env': None, 'stderr': -1, 'stdin': -1, 'stdout': -1}, retcode = 0 returncode = 128, stdout_b = b'' stderr_b = b'fatal: not a git repository (or any of the parent directories): .git\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'rev-parse', '--show-toplevel') E Return code: 128 E Expected return code: 0 E Output: (none) E Errors: E fatal: not a git repository (or any of the parent directories): .git pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: @contextlib.contextmanager def error_handler(): try: > yield pre_commit/error_handler.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ argv = ['autoupdate', '--tags-only'] def main(argv=None): argv = argv if argv is not None else sys.argv[1:] argv = [five.to_text(arg) for arg in argv] parser = argparse.ArgumentParser() # https://stackoverflow.com/a/8521644/812183 parser.add_argument( '-V', '--version', action='version', version='%(prog)s {}'.format(C.VERSION), ) subparsers = parser.add_subparsers(dest='command') autoupdate_parser = subparsers.add_parser( 'autoupdate', help="Auto-update pre-commit config to the latest repos' versions.", ) _add_color_option(autoupdate_parser) _add_config_option(autoupdate_parser) autoupdate_parser.add_argument( '--tags-only', action='store_true', help='LEGACY: for compatibility', ) autoupdate_parser.add_argument( '--bleeding-edge', action='store_true', help=( 'Update to the bleeding edge of `master` instead of the latest ' 'tagged version (the default behavior).' ), ) autoupdate_parser.add_argument( '--repo', dest='repos', action='append', metavar='REPO', help='Only update this repository -- may be specified multiple times.', ) clean_parser = subparsers.add_parser( 'clean', help='Clean out pre-commit files.', ) _add_color_option(clean_parser) _add_config_option(clean_parser) gc_parser = subparsers.add_parser('gc', help='Clean unused cached repos.') _add_color_option(gc_parser) _add_config_option(gc_parser) init_templatedir_parser = subparsers.add_parser( 'init-templatedir', help=( 'Install hook script in a directory intended for use with ' '`git config init.templateDir`.' ), ) _add_color_option(init_templatedir_parser) _add_config_option(init_templatedir_parser) init_templatedir_parser.add_argument( 'directory', help='The directory in which to write the hook script.', ) _add_hook_type_option(init_templatedir_parser) install_parser = subparsers.add_parser( 'install', help='Install the pre-commit script.', ) _add_color_option(install_parser) _add_config_option(install_parser) install_parser.add_argument( '-f', '--overwrite', action='store_true', help='Overwrite existing hooks / remove migration mode.', ) install_parser.add_argument( '--install-hooks', action='store_true', help=( 'Whether to install hook environments for all environments ' 'in the config file.' ), ) _add_hook_type_option(install_parser) install_parser.add_argument( '--allow-missing-config', action='store_true', default=False, help=( 'Whether to allow a missing `pre-commit` configuration file ' 'or exit with a failure code.' ), ) install_hooks_parser = subparsers.add_parser( 'install-hooks', help=( 'Install hook environments for all environments in the config ' 'file. You may find `pre-commit install --install-hooks` more ' 'useful.' ), ) _add_color_option(install_hooks_parser) _add_config_option(install_hooks_parser) migrate_config_parser = subparsers.add_parser( 'migrate-config', help='Migrate list configuration to new map configuration.', ) _add_color_option(migrate_config_parser) _add_config_option(migrate_config_parser) run_parser = subparsers.add_parser('run', help='Run hooks.') _add_color_option(run_parser) _add_config_option(run_parser) _add_run_options(run_parser) sample_config_parser = subparsers.add_parser( 'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE), ) _add_color_option(sample_config_parser) _add_config_option(sample_config_parser) try_repo_parser = subparsers.add_parser( 'try-repo', help='Try the hooks in a repository, useful for developing new hooks.', ) _add_color_option(try_repo_parser) _add_config_option(try_repo_parser) try_repo_parser.add_argument( 'repo', help='Repository to source hooks from.', ) try_repo_parser.add_argument( '--ref', '--rev', help=( 'Manually select a rev to run against, otherwise the `HEAD` ' 'revision will be used.' ), ) _add_run_options(try_repo_parser) uninstall_parser = subparsers.add_parser( 'uninstall', help='Uninstall the pre-commit script.', ) _add_color_option(uninstall_parser) _add_config_option(uninstall_parser) _add_hook_type_option(uninstall_parser) help = subparsers.add_parser( 'help', help='Show help for a specific command.', ) help.add_argument('help_cmd', nargs='?', help='Command to show help for.') # argparse doesn't really provide a way to use a `default` subparser if len(argv) == 0: argv = ['run'] args = parser.parse_args(argv) if args.command == 'help' and args.help_cmd: parser.parse_args([args.help_cmd, '--help']) elif args.command == 'help': parser.parse_args(['--help']) with error_handler(), logging_handler(args.color): if args.command not in COMMANDS_NO_GIT: > _adjust_args_and_chdir(args) pre_commit/main.py:294: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = Namespace(bleeding_edge=False, color=False, command='autoupdate', config='/builddir/build/BUILD/pre-commit-1.20.0/.pre-commit-config.yaml', repos=None, tags_only=True) def _adjust_args_and_chdir(args): # `--config` was specified relative to the non-root working directory if os.path.exists(args.config): args.config = os.path.abspath(args.config) if args.command in {'run', 'try-repo'}: args.files = [os.path.abspath(filename) for filename in args.files] if args.command == 'try-repo' and os.path.exists(args.repo): args.repo = os.path.abspath(args.repo) try: os.chdir(git.get_root()) except CalledProcessError: > raise FatalError( 'git failed. Is it installed, and are you in a Git repository ' 'directory?', ) E pre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory? pre_commit/main.py:127: FatalError During handling of the above exception, another exception occurred: mock_commands = auto_namedtuple(autoupdate=, clean=, uninstall=) cap_out = mock_store_dir = '/tmp/pytest-of-mockbuild/pytest-2/test_warning_on_tags_only0/0' def test_warning_on_tags_only(mock_commands, cap_out, mock_store_dir): > main.main(('autoupdate', '--tags-only')) tests/main_test.py:191: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/main.py:342: in main raise AssertionError( /usr/lib64/python3.8/contextlib.py:131: in __exit__ self.gen.throw(type, value, traceback) pre_commit/error_handler.py:80: in error_handler _log_and_exit(msg, e, traceback.format_exc()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'An error has occurred' exc = FatalError('git failed. Is it installed, and are you in a Git repository directory?') formatted = 'Traceback (most recent call last):\n File "/builddir/build/BUILD/pre-commit-1.20.0/pre_commit/main.py", line 125, in...Error(\npre_commit.error_handler.FatalError: git failed. Is it installed, and are you in a Git repository directory?\n' def _log_and_exit(msg, exc, formatted): error_msg = b''.join(( five.to_bytes(msg), b': ', five.to_bytes(type(exc).__name__), b': ', _to_bytes(exc), )) output.write_line(error_msg) store = Store() log_path = os.path.join(store.directory, 'pre-commit.log') output.write_line('Check the log at {}'.format(log_path)) with open(log_path, 'wb') as log: def _log_line(*s): # type: (*str) -> None output.write_line(*s, stream=log) _log_line('### version information') _log_line() _log_line('```') _log_line('pre-commit version: {}'.format(C.VERSION)) _log_line('sys.version:') for line in sys.version.splitlines(): _log_line(' {}'.format(line)) _log_line('sys.executable: {}'.format(sys.executable)) _log_line('os.name: {}'.format(os.name)) _log_line('sys.platform: {}'.format(sys.platform)) _log_line('```') _log_line() _log_line('### error information') _log_line() _log_line('```') _log_line(error_msg) _log_line('```') _log_line() _log_line('```') _log_line(formatted) _log_line('```') > raise SystemExit(1) E SystemExit: 1 pre_commit/error_handler.py:66: SystemExit ___________________________ test_normalize_cmd_PATH ____________________________ def test_normalize_cmd_PATH(): cmd = ('python', '--version') expected = (distutils.spawn.find_executable('python'), '--version') > assert parse_shebang.normalize_cmd(cmd) == expected tests/parse_shebang_test.py:130: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pre_commit/parse_shebang.py:72: in normalize_cmd exe = normexe(cmd[0]) pre_commit/parse_shebang.py:52: in normexe _error('not found') _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'not found' def _error(msg): > raise ExecutableNotFoundError('Executable `{}` {}'.format(orig, msg)) E pre_commit.parse_shebang.ExecutableNotFoundError: Executable `python` not found pre_commit/parse_shebang.py:47: ExecutableNotFoundError __________________________ test_normalize_cmd_shebang __________________________ in_tmpdir = '/tmp/pytest-of-mockbuild/pytest-2/test_normalize_cmd_shebang0/0' def test_normalize_cmd_shebang(in_tmpdir): > python = distutils.spawn.find_executable('python').replace(os.sep, '/') E AttributeError: 'NoneType' object has no attribute 'replace' /builddir/build/BUILD/pre-commit-1.20.0/tests/parse_shebang_test.py:134: AttributeError __________________ test_normalize_cmd_PATH_shebang_full_path ___________________ in_tmpdir = '/tmp/pytest-of-mockbuild/pytest-2/test_normalize_cmd_PATH_sheban0/0' def test_normalize_cmd_PATH_shebang_full_path(in_tmpdir): > python = distutils.spawn.find_executable('python').replace(os.sep, '/') E AttributeError: 'NoneType' object has no attribute 'replace' /builddir/build/BUILD/pre-commit-1.20.0/tests/parse_shebang_test.py:140: AttributeError _____________________ test_normalize_cmd_PATH_shebang_PATH _____________________ in_tmpdir = '/tmp/pytest-of-mockbuild/pytest-2/test_normalize_cmd_PATH_sheban1/0' def test_normalize_cmd_PATH_shebang_PATH(in_tmpdir): python = distutils.spawn.find_executable('python') path = write_executable('/usr/bin/env python') with bin_on_path(): > ret = parse_shebang.normalize_cmd(('run',)) /builddir/build/BUILD/pre-commit-1.20.0/tests/parse_shebang_test.py:151: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILD/pre-commit-1.20.0/pre_commit/parse_shebang.py:78: in normalize_cmd exe = normexe(cmd[0]) /builddir/build/BUILD/pre-commit-1.20.0/pre_commit/parse_shebang.py:52: in normexe _error('not found') _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ msg = 'not found' def _error(msg): > raise ExecutableNotFoundError('Executable `{}` {}'.format(orig, msg)) E pre_commit.parse_shebang.ExecutableNotFoundError: Executable `python` not found /builddir/build/BUILD/pre-commit-1.20.0/pre_commit/parse_shebang.py:47: ExecutableNotFoundError _________________ test_switch_language_versions_doesnt_clobber _________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53f39be0> store = def test_switch_language_versions_doesnt_clobber(tempdir_factory, store): # We're using the python3 repo because it prints the python version path = make_repo(tempdir_factory, 'python3_hooks_repo') def run_on_version(version, expected_output): config = make_config_from_repo(path) config['hooks'][0]['language_version'] = version hook = _get_hook(config, store, 'python3-hook') ret, out = hook.run([], color=False) assert ret == 0 assert _norm_out(out) == expected_output > run_on_version('python2', b'2\n[]\nHello World\n') tests/repository_test.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:141: in run_on_version hook = _get_hook(config, store, 'python3-hook') tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/python.py:169: in install_environment _make_venv(env_dir, python) pre_commit/languages/python.py:181: in make_venv cmd_output_b(*cmd, env=env, cwd='/') _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/python3', '-mvirtualenv', '/tmp/pytest-of-mockbuild/pytest-2/test_switch_language_versions_0/0/.pre-commit/repoj3t_51ky/py_env-python2', '-p', 'python2') kwargs = {'cwd': '/', 'env': {'CONFIG_SITE': 'NONE', 'GIT_AUTHOR_DATE': '2007-01-01 00:00:00 +0000', 'GIT_AUTHOR_EMAIL': 'test@example.org', 'GIT_AUTHOR_NAME': 'test', ...}, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 3 stdout_b = b'The path python2 (from --python=python2) does not exist\n' stderr_b = b'', proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/python3', '-mvirtualenv', '/tmp/pytest-of-mockbuild/pytest-2/test_switch_language_versions_0/0/.pre-commit/repoj3t_51ky/py_env-python2', '-p', 'python2') E Return code: 3 E Expected return code: 0 E Output: E The path python2 (from --python=python2) does not exist E E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_switch_language_versions_0/1. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_switch_language_versions_0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_switch_language_versions_0/1. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_switch_language_versions_0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... _____________________________ test_run_a_ruby_hook _____________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d93ac0> store = @xfailif_windows_no_ruby def test_run_a_ruby_hook(tempdir_factory, store): > _test_hook_repo( tempdir_factory, store, 'ruby_hooks_repo', 'ruby_hook', [os.devnull], b'Hello world from a ruby hook\n', ) tests/repository_test.py:216: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:77: in _test_hook_repo ret, out = _get_hook(config, store, hook_id).run(args, color=color) tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/ruby.py:117: in install_environment helpers.run_setup_cmd( pre_commit/languages/helpers.py:17: in run_setup_cmd cmd_output_b(*cmd, cwd=prefix.prefix_dir) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('gem', 'build', 'ruby_hook.gemspec') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_run_a_ruby_hook0/0/.pre-commit/reposvyxf3v5', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `gem` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('gem', 'build', 'ruby_hook.gemspec') E Return code: 1 E Expected return code: 0 E Output: E Executable `gem` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_a_ruby_hook0/1. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_a_ruby_hook0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_a_ruby_hook0/1. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_a_ruby_hook0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... _________________________ test_run_versioned_ruby_hook _________________________ prefix = Prefix(prefix_dir='/tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/0/.pre-commit/repo69klwt17') version = '2.5.1' def _install_ruby(prefix, version): # pragma: windows no cover try: > helpers.run_setup_cmd(prefix, ('rbenv', 'download', version)) pre_commit/languages/ruby.py:94: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ prefix = Prefix(prefix_dir='/tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/0/.pre-commit/repo69klwt17') cmd = ('rbenv', 'download', '2.5.1') def run_setup_cmd(prefix, cmd): > cmd_output_b(*cmd, cwd=prefix.prefix_dir) pre_commit/languages/helpers.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/bash', '/tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/0/.pre-commit/repo69klwt17/rbenv-2.5.1/bin/rbenv', 'download', '2.5.1') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/0/.pre-commit/repo69klwt17', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1 stdout_b = b'Download and extract ruby 2.5.1 from the RVM repository\n' stderr_b = b"https://rvm.io/binaries/fedora/32/x86_64/ruby-2.5.1.tar.bz2 cannot be reached\nCannot find a built version of '2.5.1' compiled for your current system: Fedora x86_64 (32)\n" proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/bash', '/tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/0/.pre-commit/repo69klwt17/rbenv-2.5.1/bin/rbenv', 'download', '2.5.1') E Return code: 1 E Expected return code: 0 E Output: E Download and extract ruby 2.5.1 from the RVM repository E E Errors: E https://rvm.io/binaries/fedora/32/x86_64/ruby-2.5.1.tar.bz2 cannot be reached E Cannot find a built version of '2.5.1' compiled for your current system: Fedora x86_64 (32) pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: tempdir_factory = .TmpdirFactory object at 0x7f6a53e69820> store = @xfailif_windows_no_ruby def test_run_versioned_ruby_hook(tempdir_factory, store): > _test_hook_repo( tempdir_factory, store, 'ruby_versioned_hooks_repo', 'ruby_hook', [os.devnull], b'2.5.1\nHello world from a ruby hook\n', ) tests/repository_test.py:224: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:77: in _test_hook_repo ret, out = _get_hook(config, store, hook_id).run(args, color=color) tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/ruby.py:114: in install_environment _install_ruby(prefix, version) pre_commit/languages/ruby.py:97: in _install_ruby helpers.run_setup_cmd(prefix, ('rbenv', 'install', version)) pre_commit/languages/helpers.py:17: in run_setup_cmd cmd_output_b(*cmd, cwd=prefix.prefix_dir) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/bash', '/tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/0/.pre-commit/repo69klwt17/rbenv-2.5.1/bin/rbenv', 'install', '2.5.1') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/0/.pre-commit/repo69klwt17', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'' stderr_b = b"Downloading ruby-2.5.1.tar.bz2...\n-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2\nInstalling ruby-2...700.54236/ruby-2.5.1':\nconfigure: error: no acceptable C compiler found in $PATH\nSee `config.log' for more details\n" proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/bash', '/tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/0/.pre-commit/repo69klwt17/rbenv-2.5.1/bin/rbenv', 'install', '2.5.1') E Return code: 1 E Expected return code: 0 E Output: (none) E Errors: E Downloading ruby-2.5.1.tar.bz2... E -> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2 E Installing ruby-2.5.1... E E BUILD FAILED (Fedora 32 using ruby-build 20191024) E E Inspect or clean up the working tree at /tmp/ruby-build.20191208163700.54236 E Results logged to /tmp/ruby-build.20191208163700.54236.log E E Last 10 log lines: E checking for ruby... false E checking build system type... x86_64-pc-linux-gnu E checking host system type... x86_64-pc-linux-gnu E checking target system type... x86_64-pc-linux-gnu E checking for gcc... no E checking for cc... no E checking for cl.exe... no E configure: error: in `/tmp/ruby-build.20191208163700.54236/ruby-2.5.1': E configure: error: no acceptable C compiler found in $PATH E See `config.log' for more details pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/1. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/1. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_versioned_ruby_hook0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... _________________ test_run_ruby_hook_with_disable_shared_gems __________________ prefix = Prefix(prefix_dir='/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/0/.pre-commit/repoookzyag0') version = '2.5.1' def _install_ruby(prefix, version): # pragma: windows no cover try: > helpers.run_setup_cmd(prefix, ('rbenv', 'download', version)) pre_commit/languages/ruby.py:94: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ prefix = Prefix(prefix_dir='/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/0/.pre-commit/repoookzyag0') cmd = ('rbenv', 'download', '2.5.1') def run_setup_cmd(prefix, cmd): > cmd_output_b(*cmd, cwd=prefix.prefix_dir) pre_commit/languages/helpers.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/bash', '/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/0/.pre-commit/repoookzyag0/rbenv-2.5.1/bin/rbenv', 'download', '2.5.1') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/0/.pre-commit/repoookzyag0', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1 stdout_b = b'Download and extract ruby 2.5.1 from the RVM repository\n' stderr_b = b"https://rvm.io/binaries/fedora/32/x86_64/ruby-2.5.1.tar.bz2 cannot be reached\nCannot find a built version of '2.5.1' compiled for your current system: Fedora x86_64 (32)\n" proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/bash', '/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/0/.pre-commit/repoookzyag0/rbenv-2.5.1/bin/rbenv', 'download', '2.5.1') E Return code: 1 E Expected return code: 0 E Output: E Download and extract ruby 2.5.1 from the RVM repository E E Errors: E https://rvm.io/binaries/fedora/32/x86_64/ruby-2.5.1.tar.bz2 cannot be reached E Cannot find a built version of '2.5.1' compiled for your current system: Fedora x86_64 (32) pre_commit/util.py:146: CalledProcessError During handling of the above exception, another exception occurred: tempdir_factory = .TmpdirFactory object at 0x7f6a53cb2a90> store = tmpdir = local('/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0') @xfailif_windows_no_ruby def test_run_ruby_hook_with_disable_shared_gems( tempdir_factory, store, tmpdir, ): """Make sure a Gemfile in the project doesn't interfere.""" tmpdir.join('Gemfile').write('gem "lol_hai"') tmpdir.join('.bundle').mkdir() tmpdir.join('.bundle', 'config').write( 'BUNDLE_DISABLE_SHARED_GEMS: true\n' 'BUNDLE_PATH: vendor/gem\n', ) with cwd(tmpdir.strpath): > _test_hook_repo( tempdir_factory, store, 'ruby_versioned_hooks_repo', 'ruby_hook', [os.devnull], b'2.5.1\nHello world from a ruby hook\n', ) tests/repository_test.py:246: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:77: in _test_hook_repo ret, out = _get_hook(config, store, hook_id).run(args, color=color) tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/ruby.py:114: in install_environment _install_ruby(prefix, version) pre_commit/languages/ruby.py:97: in _install_ruby helpers.run_setup_cmd(prefix, ('rbenv', 'install', version)) pre_commit/languages/helpers.py:17: in run_setup_cmd cmd_output_b(*cmd, cwd=prefix.prefix_dir) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/bash', '/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/0/.pre-commit/repoookzyag0/rbenv-2.5.1/bin/rbenv', 'install', '2.5.1') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/0/.pre-commit/repoookzyag0', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'' stderr_b = b"Downloading ruby-2.5.1.tar.bz2...\n-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2\nInstalling ruby-2...713.54616/ruby-2.5.1':\nconfigure: error: no acceptable C compiler found in $PATH\nSee `config.log' for more details\n" proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/bash', '/tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/0/.pre-commit/repoookzyag0/rbenv-2.5.1/bin/rbenv', 'install', '2.5.1') E Return code: 1 E Expected return code: 0 E Output: (none) E Errors: E Downloading ruby-2.5.1.tar.bz2... E -> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2 E Installing ruby-2.5.1... E E BUILD FAILED (Fedora 32 using ruby-build 20191024) E E Inspect or clean up the working tree at /tmp/ruby-build.20191208163713.54616 E Results logged to /tmp/ruby-build.20191208163713.54616.log E E Last 10 log lines: E checking for ruby... false E checking build system type... x86_64-pc-linux-gnu E checking host system type... x86_64-pc-linux-gnu E checking target system type... x86_64-pc-linux-gnu E checking for gcc... no E checking for cc... no E checking for cl.exe... no E configure: error: in `/tmp/ruby-build.20191208163713.54616/ruby-2.5.1': E configure: error: no acceptable C compiler found in $PATH E See `config.log' for more details pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/1. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/1. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_run_ruby_hook_with_disabl0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... _______________________________ test_golang_hook _______________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d8e7c0> store = def test_golang_hook(tempdir_factory, store): > _test_hook_repo( tempdir_factory, store, 'golang_hooks_repo', 'golang-hook', [], b'hello world\n', ) tests/repository_test.py:270: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:77: in _test_hook_repo ret, out = _get_hook(config, store, hook_id).run(args, color=color) tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/golang.py:74: in install_environment cmd_output_b('go', 'get', './...', cwd=repo_src_dir, env=env) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('go', 'get', './...') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_golang_hook0/0/.pre-commit/repoomi4msbf/golangenv-default/src/unknown_...:00:00 +0000', 'GIT_AUTHOR_EMAIL': 'test@example.org', 'GIT_AUTHOR_NAME': 'test', ...}, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `go` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('go', 'get', './...') E Return code: 1 E Expected return code: 0 E Output: E Executable `go` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_golang_hook0/1. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_golang_hook0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_golang_hook0/1. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_golang_hook0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... ________________ test_golang_hook_still_works_when_gobin_is_set ________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53cb76a0> store = def test_golang_hook_still_works_when_gobin_is_set(tempdir_factory, store): gobin_dir = tempdir_factory.get() with envcontext([('GOBIN', gobin_dir)]): > test_golang_hook(tempdir_factory, store) tests/repository_test.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:270: in test_golang_hook _test_hook_repo( tests/repository_test.py:77: in _test_hook_repo ret, out = _get_hook(config, store, hook_id).run(args, color=color) tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/golang.py:74: in install_environment cmd_output_b('go', 'get', './...', cwd=repo_src_dir, env=env) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('go', 'get', './...') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_golang_hook_still_works_w0/0/.pre-commit/repofvwx4up9/golangenv-defaul...:00:00 +0000', 'GIT_AUTHOR_EMAIL': 'test@example.org', 'GIT_AUTHOR_NAME': 'test', ...}, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `go` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('go', 'get', './...') E Return code: 1 E Expected return code: 0 E Output: E Executable `go` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_golang_hook_still_works_w0/2. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_golang_hook_still_works_w0/2. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_golang_hook_still_works_w0/2. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_golang_hook_still_works_w0/2. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... ________________________________ test_rust_hook ________________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d76820> store = def test_rust_hook(tempdir_factory, store): > _test_hook_repo( tempdir_factory, store, 'rust_hooks_repo', 'rust-hook', [], b'hello world\n', ) tests/repository_test.py:284: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:77: in _test_hook_repo ret, out = _get_hook(config, store, hook_id).run(args, color=color) tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/rust.py:86: in install_environment cmd_output_b( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_rust_hook0/0/.pre-commit/repowksemzhw/rustenv-default', '--path', ...) kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_rust_hook0/0/.pre-commit/repowksemzhw', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `cargo` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_rust_hook0/0/.pre-commit/repowksemzhw/rustenv-default', '--path', '.') E Return code: 1 E Expected return code: 0 E Output: E Executable `cargo` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_rust_hook0/1. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_rust_hook0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_rust_hook0/1. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_rust_hook0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... ____ test_additional_rust_cli_dependencies_installed[cli:shellharden:3.1.0] ____ tempdir_factory = .TmpdirFactory object at 0x7f6a53e99430> store = dep = 'cli:shellharden:3.1.0' @pytest.mark.parametrize('dep', ('cli:shellharden:3.1.0', 'cli:shellharden')) def test_additional_rust_cli_dependencies_installed( tempdir_factory, store, dep, ): path = make_repo(tempdir_factory, 'rust_hooks_repo') config = make_config_from_repo(path) # A small rust package with no dependencies. config['hooks'][0]['additional_dependencies'] = [dep] > hook = _get_hook(config, store, 'rust-hook') tests/repository_test.py:298: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/rust.py:86: in install_environment cmd_output_b( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/0/.pre-commit/repovojzlmi0/rustenv-default', '--path', ...) kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/0/.pre-commit/repovojzlmi0', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `cargo` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/0/.pre-commit/repovojzlmi0/rustenv-default', '--path', '.') E Return code: 1 E Expected return code: 0 E Output: E Executable `cargo` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/1. [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/1:cli:shellharden:3.1.0. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/1. INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/1:cli:shellharden:3.1.0. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... _______ test_additional_rust_cli_dependencies_installed[cli:shellharden] _______ tempdir_factory = .TmpdirFactory object at 0x7f6a53d85670> store = dep = 'cli:shellharden' @pytest.mark.parametrize('dep', ('cli:shellharden:3.1.0', 'cli:shellharden')) def test_additional_rust_cli_dependencies_installed( tempdir_factory, store, dep, ): path = make_repo(tempdir_factory, 'rust_hooks_repo') config = make_config_from_repo(path) # A small rust package with no dependencies. config['hooks'][0]['additional_dependencies'] = [dep] > hook = _get_hook(config, store, 'rust-hook') tests/repository_test.py:298: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/rust.py:86: in install_environment cmd_output_b( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/0/.pre-commit/repol7naf1bt/rustenv-default', 'shellharden') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/0/.pre-commit/repol7naf1bt', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `cargo` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/0/.pre-commit/repol7naf1bt/rustenv-default', 'shellharden') E Return code: 1 E Expected return code: 0 E Output: E Executable `cargo` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/1. [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/1:cli:shellharden. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/1. INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/1:cli:shellharden. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_cli_depen1/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... _______________ test_additional_rust_lib_dependencies_installed ________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53deb7f0> store = def test_additional_rust_lib_dependencies_installed( tempdir_factory, store, ): path = make_repo(tempdir_factory, 'rust_hooks_repo') config = make_config_from_repo(path) # A small rust package with no dependencies. deps = ['shellharden:3.1.0'] config['hooks'][0]['additional_dependencies'] = deps > hook = _get_hook(config, store, 'rust-hook') tests/repository_test.py:317: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/rust.py:86: in install_environment cmd_output_b( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/0/.pre-commit/repo0216mfsq/rustenv-default', '--path', ...) kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/0/.pre-commit/repo0216mfsq', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `cargo` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/0/.pre-commit/repo0216mfsq/rustenv-default', '--path', '.') E Return code: 1 E Expected return code: 0 E Output: E Executable `cargo` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/1. [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/1:shellharden:3.1.0. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/1. INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/1:shellharden:3.1.0. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_rust_lib_depen0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... ________________________ test_intermixed_stdout_stderr _________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53fc6ca0> store = def test_intermixed_stdout_stderr(tempdir_factory, store): > _test_hook_repo( tempdir_factory, store, 'stdout_stderr_repo', 'stdout-stderr', [], b'0\n1\n2\n3\n4\n5\n', ) tests/repository_test.py:370: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tempdir_factory = .TmpdirFactory object at 0x7f6a53fc6ca0> store = repo_path = 'stdout_stderr_repo', hook_id = 'stdout-stderr', args = [] expected = b'0\n1\n2\n3\n4\n5\n', expected_return_code = 0, config_kwargs = None color = False def _test_hook_repo( tempdir_factory, store, repo_path, hook_id, args, expected, expected_return_code=0, config_kwargs=None, color=False, ): path = make_repo(tempdir_factory, repo_path) config = make_config_from_repo(path, **(config_kwargs or {})) ret, out = _get_hook(config, store, hook_id).run(args, color=color) > assert ret == expected_return_code E assert 1 == 0 E -1 E +0 tests/repository_test.py:78: AssertionError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_intermixed_stdout_stderr0/1. ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_intermixed_stdout_stderr0/1. ______________________________ test_output_isatty ______________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53fc6fa0> store = @pytest.mark.xfail(os.name == 'nt', reason='ptys are posix-only') def test_output_isatty(tempdir_factory, store): > _test_hook_repo( tempdir_factory, store, 'stdout_stderr_repo', 'tty-check', [], b'stdin: False\nstdout: True\nstderr: True\n', color=True, ) tests/repository_test.py:380: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tempdir_factory = .TmpdirFactory object at 0x7f6a53fc6fa0> store = repo_path = 'stdout_stderr_repo', hook_id = 'tty-check', args = [] expected = b'stdin: False\nstdout: True\nstderr: True\n' expected_return_code = 0, config_kwargs = None, color = True def _test_hook_repo( tempdir_factory, store, repo_path, hook_id, args, expected, expected_return_code=0, config_kwargs=None, color=False, ): path = make_repo(tempdir_factory, repo_path) config = make_config_from_repo(path, **(config_kwargs or {})) ret, out = _get_hook(config, store, hook_id).run(args, color=color) > assert ret == expected_return_code E assert 1 == 0 E -1 E +0 tests/repository_test.py:78: AssertionError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_output_isatty0/1. ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_output_isatty0/1. ______________________ TestPygrep.test_grep_hook_matching ______________________ self = greppable_files = local('/tmp/pytest-of-mockbuild/pytest-2/test_grep_hook_matching0') store = def test_grep_hook_matching(self, greppable_files, store): hook = _make_grep_repo(self.language, 'ello', store) ret, out = hook.run(('f1', 'f2', 'f3'), color=False) assert ret == 1 > assert _norm_out(out) == b"f1:1:hello'hi\n" E assert b"/usr/bin/py...re_commit')\n" == b"f1:1:hello'hi\n" E At index 0 diff: 47 != 102 E Left contains 131 more items, first extra item: 110 E Full diff: E + b"f1:1:hello'hi\n" E - (b"/usr/bin/python3: Error while finding module specification for 'pre_commit.l" E - b"anguages.pygrep' (ModuleNotFoundError: No module named 'pre_commit')\n") /builddir/build/BUILD/pre-commit-1.20.0/tests/repository_test.py:421: AssertionError __________________ TestPygrep.test_grep_hook_case_insensitive __________________ self = greppable_files = local('/tmp/pytest-of-mockbuild/pytest-2/test_grep_hook_case_insensitiv0') store = def test_grep_hook_case_insensitive(self, greppable_files, store): hook = _make_grep_repo(self.language, 'ELLO', store, args=['-i']) ret, out = hook.run(('f1', 'f2', 'f3'), color=False) assert ret == 1 > assert _norm_out(out) == b"f1:1:hello'hi\n" E assert b"/usr/bin/py...re_commit')\n" == b"f1:1:hello'hi\n" E At index 0 diff: 47 != 102 E Left contains 131 more items, first extra item: 110 E Full diff: E + b"f1:1:hello'hi\n" E - (b"/usr/bin/python3: Error while finding module specification for 'pre_commit.l" E - b"anguages.pygrep' (ModuleNotFoundError: No module named 'pre_commit')\n") /builddir/build/BUILD/pre-commit-1.20.0/tests/repository_test.py:427: AssertionError _________________ TestPygrep.test_grep_hook_not_matching[nope] _________________ self = regex = 'nope' greppable_files = local('/tmp/pytest-of-mockbuild/pytest-2/test_grep_hook_not_matching_no0') store = @pytest.mark.parametrize('regex', ('nope', "foo'bar", r'^\[INFO\]')) def test_grep_hook_not_matching(self, regex, greppable_files, store): hook = _make_grep_repo(self.language, regex, store) ret, out = hook.run(('f1', 'f2', 'f3'), color=False) > assert (ret, out) == (0, b'') E assert (1, b"/usr/bi...e_commit')\n") == (0, b'') E At index 0 diff: 1 != 0 E Full diff: E + (0, b'') E - (1, E - b"/usr/bin/python3: Error while finding module specification for 'pre_commit.l" E - b"anguages.pygrep' (ModuleNotFoundError: No module named 'pre_commit')\n") /builddir/build/BUILD/pre-commit-1.20.0/tests/repository_test.py:433: AssertionError _______________ TestPygrep.test_grep_hook_not_matching[foo'bar] ________________ self = regex = "foo'bar" greppable_files = local('/tmp/pytest-of-mockbuild/pytest-2/test_grep_hook_not_matching_fo0') store = @pytest.mark.parametrize('regex', ('nope', "foo'bar", r'^\[INFO\]')) def test_grep_hook_not_matching(self, regex, greppable_files, store): hook = _make_grep_repo(self.language, regex, store) ret, out = hook.run(('f1', 'f2', 'f3'), color=False) > assert (ret, out) == (0, b'') E assert (1, b"/usr/bi...e_commit')\n") == (0, b'') E At index 0 diff: 1 != 0 E Full diff: E + (0, b'') E - (1, E - b"/usr/bin/python3: Error while finding module specification for 'pre_commit.l" E - b"anguages.pygrep' (ModuleNotFoundError: No module named 'pre_commit')\n") /builddir/build/BUILD/pre-commit-1.20.0/tests/repository_test.py:433: AssertionError _____________ TestPygrep.test_grep_hook_not_matching[^\\[INFO\\]] ______________ self = regex = '^\\[INFO\\]' greppable_files = local('/tmp/pytest-of-mockbuild/pytest-2/test_grep_hook_not_matching___0') store = @pytest.mark.parametrize('regex', ('nope', "foo'bar", r'^\[INFO\]')) def test_grep_hook_not_matching(self, regex, greppable_files, store): hook = _make_grep_repo(self.language, regex, store) ret, out = hook.run(('f1', 'f2', 'f3'), color=False) > assert (ret, out) == (0, b'') E assert (1, b"/usr/bi...e_commit')\n") == (0, b'') E At index 0 diff: 1 != 0 E Full diff: E + (0, b'') E - (1, E - b"/usr/bin/python3: Error while finding module specification for 'pre_commit.l" E - b"anguages.pygrep' (ModuleNotFoundError: No module named 'pre_commit')\n") /builddir/build/BUILD/pre-commit-1.20.0/tests/repository_test.py:433: AssertionError _________________ test_additional_ruby_dependencies_installed __________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d2fd30> store = @xfailif_windows_no_ruby # pragma: windows no cover def test_additional_ruby_dependencies_installed(tempdir_factory, store): path = make_repo(tempdir_factory, 'ruby_hooks_repo') config = make_config_from_repo(path) config['hooks'][0]['additional_dependencies'] = ['tins'] > hook = _get_hook(config, store, 'ruby_hook') tests/repository_test.py:511: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/ruby.py:117: in install_environment helpers.run_setup_cmd( pre_commit/languages/helpers.py:17: in run_setup_cmd cmd_output_b(*cmd, cwd=prefix.prefix_dir) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('gem', 'build', 'ruby_hook.gemspec') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_additional_ruby_dependenc0/0/.pre-commit/repo8myf3a7a', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `gem` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('gem', 'build', 'ruby_hook.gemspec') E Return code: 1 E Expected return code: 0 E Output: E Executable `gem` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_ruby_dependenc0/1. [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_ruby_dependenc0/1:tins. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_ruby_dependenc0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_ruby_dependenc0/1. INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_ruby_dependenc0/1:tins. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_ruby_dependenc0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... ________________ test_additional_golang_dependencies_installed _________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d03be0> store = def test_additional_golang_dependencies_installed( tempdir_factory, store, ): path = make_repo(tempdir_factory, 'golang_hooks_repo') config = make_config_from_repo(path) # A small go package deps = ['github.com/golang/example/hello'] config['hooks'][0]['additional_dependencies'] = deps > hook = _get_hook(config, store, 'golang-hook') tests/repository_test.py:537: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/golang.py:74: in install_environment cmd_output_b('go', 'get', './...', cwd=repo_src_dir, env=env) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('go', 'get', './...') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_additional_golang_depende0/0/.pre-commit/repo8h4g1zyh/golangenv-defaul...:00:00 +0000', 'GIT_AUTHOR_EMAIL': 'test@example.org', 'GIT_AUTHOR_NAME': 'test', ...}, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `go` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('go', 'get', './...') E Return code: 1 E Expected return code: 0 E Output: E Executable `go` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_golang_depende0/1. [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_golang_depende0/1:github.com/golang/example/hello. [INFO] Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_golang_depende0/1. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_golang_depende0/1. INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_golang_depende0/1:github.com/golang/example/hello. INFO pre_commit:repository.py:85 Installing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_additional_golang_depende0/1. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... __________________ test_local_golang_additional_dependencies ___________________ store = def test_local_golang_additional_dependencies(store): config = { 'repo': 'local', 'hooks': [{ 'id': 'hello', 'name': 'hello', 'entry': 'hello', 'language': 'golang', 'additional_dependencies': ['github.com/golang/example/hello'], }], } > ret, out = _get_hook(config, store, 'hello').run((), color=False) tests/repository_test.py:559: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/golang.py:74: in install_environment cmd_output_b('go', 'get', './...', cwd=repo_src_dir, env=env) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('go', 'get', './...') kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_local_golang_additional_d0/0/.pre-commit/repor5gmzo12/golangenv-defaul...:00:00 +0000', 'GIT_AUTHOR_EMAIL': 'test@example.org', 'GIT_AUTHOR_NAME': 'test', ...}, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `go` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('go', 'get', './...') E Return code: 1 E Expected return code: 0 E Output: E Executable `go` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for local:github.com/golang/example/hello. [INFO] Installing environment for local. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for local:github.com/golang/example/hello. INFO pre_commit:repository.py:85 Installing environment for local. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... ___________________ test_local_rust_additional_dependencies ____________________ store = def test_local_rust_additional_dependencies(store): config = { 'repo': 'local', 'hooks': [{ 'id': 'hello', 'name': 'hello', 'entry': 'hello', 'language': 'rust', 'additional_dependencies': ['cli:hello-cli:0.2.2'], }], } > ret, out = _get_hook(config, store, 'hello').run((), color=False) tests/repository_test.py:575: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/repository_test.py:60: in _get_hook install_hook_envs([hook], store) pre_commit/repository.py:220: in install_hook_envs hook.install() pre_commit/repository.py:97: in install lang.install_environment( pre_commit/languages/rust.py:86: in install_environment cmd_output_b( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_local_rust_additional_dep0/0/.pre-commit/repodvz1zxtu/rustenv-default', '--path', ...) kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_local_rust_additional_dep0/0/.pre-commit/repodvz1zxtu', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'Executable `cargo` not found' stderr_b = b'' def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('cargo', 'install', '--bins', '--root', '/tmp/pytest-of-mockbuild/pytest-2/test_local_rust_additional_dep0/0/.pre-commit/repodvz1zxtu/rustenv-default', '--path', '.') E Return code: 1 E Expected return code: 0 E Output: E Executable `cargo` not found E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- [INFO] Initializing environment for local:cli:hello-cli:0.2.2. [INFO] Installing environment for local. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for local:cli:hello-cli:0.2.2. INFO pre_commit:repository.py:85 Installing environment for local. INFO pre_commit:repository.py:86 Once installed this environment will be reused. INFO pre_commit:repository.py:87 This may take a few minutes... ____________________________ test_init_templatedir _____________________________ tmpdir = local('/tmp/pytest-of-mockbuild/pytest-2/test_init_templatedir1') tempdir_factory = .TmpdirFactory object at 0x7f6a53e74f40> store = cap_out = def test_init_templatedir(tmpdir, tempdir_factory, store, cap_out): target = str(tmpdir.join('tmpl')) init_templatedir(C.CONFIG_FILE, store, target, hook_types=['pre-commit']) lines = cap_out.get().splitlines() assert lines[0].startswith('pre-commit installed at ') assert lines[1] == ( '[WARNING] `init.templateDir` not set to the target directory' ) assert lines[2].startswith( '[WARNING] maybe `git config --global init.templateDir', ) with envcontext([('GIT_TEMPLATE_DIR', target)]): > path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') tests/commands/init_templatedir_test.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ testing/fixtures.py:150: in make_consuming_repo return add_config_to_repo(git_path, config) testing/fixtures.py:136: in add_config_to_repo git_commit(msg=add_config_to_repo.__name__, cwd=git_path) testing/util.py:144: in git_commit return fn(*cmd, **kwargs) pre_commit/util.py:154: in cmd_output returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'commit', '--allow-empty', '--no-gpg-sign', '-a', '-m', ...) kwargs = {'cwd': '/tmp/pytest-of-mockbuild/pytest-2/test_init_templatedir1/2', 'env': None, 'stderr': -1, 'stdin': -1, ...} retcode = 0, returncode = 1, stdout_b = b'' stderr_b = b'`pre-commit` not found. Did you forget to activate your virtualenv?\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'commit', '--allow-empty', '--no-gpg-sign', '-a', '-m', 'add_config_to_repo') E Return code: 1 E Expected return code: 0 E Output: (none) E Errors: E `pre-commit` not found. Did you forget to activate your virtualenv? pre_commit/util.py:146: CalledProcessError ------------------------------ Captured log call ------------------------------- WARNING pre_commit:init_templatedir.py:24 `init.templateDir` not set to the target directory WARNING pre_commit:init_templatedir.py:25 maybe `git config --global init.templateDir /tmp/pytest-of-mockbuild/pytest-2/test_init_templatedir1/tmpl`? _______________________ test_install_pre_commit_and_run ________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53dbc1f0> store = def test_install_pre_commit_and_run(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:157: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit _________________ test_install_pre_commit_and_run_custom_path __________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53debbe0> store = def test_install_pre_commit_and_run_custom_path(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): cmd_output('git', 'mv', C.CONFIG_FILE, 'custom.yaml') git_commit(cwd=path) assert install('custom.yaml', store, hook_types=['pre-commit']) == 0 ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:169: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit ______________________ test_install_in_submodule_and_run _______________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d97f10> store = def test_install_in_submodule_and_run(tempdir_factory, store): src_path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') parent_path = git_dir(tempdir_factory) cmd_output('git', 'submodule', 'add', src_path, 'sub', cwd=parent_path) git_commit(cwd=parent_path) sub_pth = os.path.join(parent_path, 'sub') with cwd(sub_pth): assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:183: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at /tmp/pytest-of-mockbuild/pytest-2/test_install_in_submodule_and_0/3/.git/modules/sub/hooks/pre-commit _______________________ test_install_in_worktree_and_run _______________________ tempdir_factory = .TmpdirFactory object at 0x7f6a54180ac0> store = def test_install_in_worktree_and_run(tempdir_factory, store): src_path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') path = tempdir_factory.get() cmd_output('git', '-C', src_path, 'branch', '-m', 'notmaster') cmd_output('git', '-C', src_path, 'worktree', 'add', path, '-b', 'master') with cwd(path): assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:196: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at /tmp/pytest-of-mockbuild/pytest-2/test_install_in_worktree_and_r0/2/.git/hooks/pre-commit ________________________________ test_commit_am ________________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53e69eb0> store = def test_commit_am(tempdir_factory, store): """Regression test for #322.""" path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): # Make an unstaged change open('unstaged', 'w').close() cmd_output('git', 'add', '.') git_commit(cwd=path) with io.open('unstaged', 'w') as foo_file: foo_file.write('Oh hai') assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:214: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit ______________________ test_unicode_merge_commit_message _______________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53e85c40> store = def test_unicode_merge_commit_message(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 cmd_output('git', 'checkout', 'master', '-b', 'foo') git_commit('-n', cwd=path) cmd_output('git', 'checkout', 'master') cmd_output('git', 'merge', 'foo', '--no-ff', '--no-commit', '-m', '☃') # Used to crash > git_commit( '--no-edit', msg=None, fn=cmd_output_mocked_pre_commit_home, tempdir_factory=tempdir_factory, ) tests/commands/install_uninstall_test.py:226: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ testing/util.py:144: in git_commit return fn(*cmd, **kwargs) testing/util.py:29: in cmd_output_mocked_pre_commit_home return cmd_output(*args, env=env, **kwargs) pre_commit/util.py:154: in cmd_output returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'commit', '--allow-empty', '--no-gpg-sign', '-a', '--no-edit') kwargs = {'env': {'CONFIG_SITE': 'NONE', 'GIT_AUTHOR_DATE': '2007-01-01 00:00:00 +0000', 'GIT_AUTHOR_EMAIL': 'test@example.org', 'GIT_AUTHOR_NAME': 'test', ...}, 'stderr': -1, 'stdin': -1, 'stdout': -1} retcode = 0, returncode = 1, stdout_b = b'' stderr_b = b'`pre-commit` not found. Did you forget to activate your virtualenv?\n' proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'commit', '--allow-empty', '--no-gpg-sign', '-a', '--no-edit') E Return code: 1 E Expected return code: 0 E Output: (none) E Errors: E `pre-commit` not found. Did you forget to activate your virtualenv? pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit ___________________________ test_install_idempotent ____________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a51c082b0> store = def test_install_idempotent(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:241: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit pre-commit installed at .git/hooks/pre-commit ______________________ test_failing_hooks_returns_nonzero ______________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d09d30> store = def test_failing_hooks_returns_nonzero(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'failing_hook_repo') with cwd(path): assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 ret, output = _get_commit_output(tempdir_factory) assert ret == 1 > assert FAILING_PRE_COMMIT_RUN.match(output) E AssertionError: assert None E + where None = ('`pre-commit` not found. Did you forget to activate your virtualenv?\n') E + where = re.compile('^\\[INFO\\] Initializing environment for .+\\.\\r?\\nFailing hook\\.+Failed\\r?\\nhookid: failing_hook\\r?\\n\\r?\\nFail\\r?\\nfoo\\r?\\n\\r?\\n$').match tests/commands/install_uninstall_test.py:306: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit ___________________ test_install_existing_hooks_no_overwrite ___________________ tempdir_factory = .TmpdirFactory object at 0x7f6a51c08cd0> store = def test_install_existing_hooks_no_overwrite(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): _write_legacy_hook(path) # Make sure we installed the "old" hook correctly ret, output = _get_commit_output(tempdir_factory, touch_file='baz') assert ret == 0 assert EXISTING_COMMIT_RUN.match(output) # Now install pre-commit (no-overwrite) assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 # We should run both the legacy and pre-commit hooks ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:339: AssertionError ----------------------------- Captured stdout call ----------------------------- Running in migration mode with existing hooks at .git/hooks/pre-commit.legacy Use -f to use only pre-commit. pre-commit installed at .git/hooks/pre-commit ______________ test_install_existing_hook_no_overwrite_idempotent ______________ tempdir_factory = .TmpdirFactory object at 0x7f6a52360370> store = def test_install_existing_hook_no_overwrite_idempotent(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): _write_legacy_hook(path) # Install twice assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 # We should run both the legacy and pre-commit hooks ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:365: AssertionError ----------------------------- Captured stdout call ----------------------------- Running in migration mode with existing hooks at .git/hooks/pre-commit.legacy Use -f to use only pre-commit. pre-commit installed at .git/hooks/pre-commit Running in migration mode with existing hooks at .git/hooks/pre-commit.legacy Use -f to use only pre-commit. pre-commit installed at .git/hooks/pre-commit _____________________ test_failing_existing_hook_returns_1 _____________________ tempdir_factory = .TmpdirFactory object at 0x7f6a5239c8e0> store = def test_failing_existing_hook_returns_1(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): # Write out a failing "old" hook mkdirp(os.path.join(path, '.git/hooks')) with io.open(os.path.join(path, '.git/hooks/pre-commit'), 'w') as f: f.write('#!/usr/bin/env bash\necho "fail!"\nexit 1\n') make_executable(f.name) assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 # We should get a failure from the legacy hook ret, output = _get_commit_output(tempdir_factory) assert ret == 1 > assert FAIL_OLD_HOOK.match(output) E AssertionError: assert None E + where None = ('fail!\n`pre-commit` not found. Did you forget to activate your virtualenv?\n') E + where = re.compile('fail!\\r?\\n\\[INFO\\] Initializing environment for .+\\.\\r?\\nBash hook\\.+Passed\\r?\\n').match tests/commands/install_uninstall_test.py:391: AssertionError ----------------------------- Captured stdout call ----------------------------- Running in migration mode with existing hooks at .git/hooks/pre-commit.legacy Use -f to use only pre-commit. pre-commit installed at .git/hooks/pre-commit ___________________ test_install_overwrite_no_existing_hooks ___________________ tempdir_factory = .TmpdirFactory object at 0x7f6a5238e970> store = def test_install_overwrite_no_existing_hooks(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): assert not install( C.CONFIG_FILE, store, hook_types=['pre-commit'], overwrite=True, ) ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:402: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit ____________________________ test_install_overwrite ____________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a523e46a0> store = def test_install_overwrite(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): _write_legacy_hook(path) assert not install( C.CONFIG_FILE, store, hook_types=['pre-commit'], overwrite=True, ) ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:415: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit ________________________ test_replace_old_commit_script ________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53f18e80> store = def test_replace_old_commit_script(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): # Install a script that looks like our old script pre_commit_contents = resource_text('hook-tmpl') new_contents = pre_commit_contents.replace( CURRENT_HASH, PRIOR_HASHES[-1], ) mkdirp(os.path.join(path, '.git/hooks')) with io.open(os.path.join(path, '.git/hooks/pre-commit'), 'w') as f: f.write(new_contents) make_executable(f.name) # Install normally assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0 ret, output = _get_commit_output(tempdir_factory) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:452: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit _____________________ test_installs_hooks_with_hooks_True ______________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d2f2e0> store = def test_installs_hooks_with_hooks_True(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): install(C.CONFIG_FILE, store, hook_types=['pre-commit'], hooks=True) ret, output = _get_commit_output( tempdir_factory, pre_commit_home=store.directory, ) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:482: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_installs_hooks_with_hooks0/1. ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_installs_hooks_with_hooks0/1. __________________________ test_install_hooks_command __________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a54161490> store = def test_install_hooks_command(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): install(C.CONFIG_FILE, store, hook_types=['pre-commit']) install_hooks(C.CONFIG_FILE, store) ret, output = _get_commit_output( tempdir_factory, pre_commit_home=store.directory, ) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:495: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit [INFO] Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_install_hooks_command0/1. ------------------------------ Captured log call ------------------------------- INFO pre_commit:store.py:125 Initializing environment for file:///tmp/pytest-of-mockbuild/pytest-2/test_install_hooks_command0/1. ___________________________ test_installed_from_venv ___________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53eb9130> store = def test_installed_from_venv(tempdir_factory, store): path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(path): install(C.CONFIG_FILE, store, hook_types=['pre-commit']) # No environment so pre-commit is not on the path when running! # Should still pick up the python from when we installed ret, output = _get_commit_output( tempdir_factory, env={ 'HOME': os.path.expanduser('~'), 'PATH': _path_without_us(), 'TERM': os.environ.get('TERM', ''), # Windows needs this to import `random` 'SYSTEMROOT': os.environ.get('SYSTEMROOT', ''), # Windows needs this to resolve executables 'PATHEXT': os.environ.get('PATHEXT', ''), # Git needs this to make a commit 'GIT_AUTHOR_NAME': os.environ['GIT_AUTHOR_NAME'], 'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'], 'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'], 'GIT_COMMITTER_EMAIL': os.environ['GIT_COMMITTER_EMAIL'], }, ) > assert ret == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:522: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit ______________________ test_pre_push_integration_failing _______________________ tempdir_factory = .TmpdirFactory object at 0x7f6a54028e20> store = def test_pre_push_integration_failing(tempdir_factory, store): upstream = make_consuming_repo(tempdir_factory, 'failing_hook_repo') path = tempdir_factory.get() cmd_output('git', 'clone', upstream, path) with cwd(path): install(C.CONFIG_FILE, store, hook_types=['pre-push']) # commit succeeds because pre-commit is only installed for pre-push assert _get_commit_output(tempdir_factory)[0] == 0 assert _get_commit_output(tempdir_factory, touch_file='zzz')[0] == 0 retc, output = _get_push_output(tempdir_factory) assert retc == 1 > assert 'Failing hook' in output E assert 'Failing hook' in "`pre-commit` not found. Did you forget to activate your virtualenv?\nerror: failed to push some refs to '/tmp/pytest-of-mockbuild/pytest-2/test_pre_push_integration_fail0/2'\n" tests/commands/install_uninstall_test.py:548: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-push ______________________ test_pre_push_integration_accepted ______________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53cb28e0> store = def test_pre_push_integration_accepted(tempdir_factory, store): upstream = make_consuming_repo(tempdir_factory, 'script_hooks_repo') path = tempdir_factory.get() cmd_output('git', 'clone', upstream, path) with cwd(path): install(C.CONFIG_FILE, store, hook_types=['pre-push']) assert _get_commit_output(tempdir_factory)[0] == 0 retc, output = _get_push_output(tempdir_factory) > assert retc == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:563: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-push ____________________ test_pre_push_force_push_without_fetch ____________________ tempdir_factory = .TmpdirFactory object at 0x7f6a5400f3d0> store = def test_pre_push_force_push_without_fetch(tempdir_factory, store): upstream = make_consuming_repo(tempdir_factory, 'script_hooks_repo') path1 = tempdir_factory.get() path2 = tempdir_factory.get() cmd_output('git', 'clone', upstream, path1) cmd_output('git', 'clone', upstream, path2) with cwd(path1): assert _get_commit_output(tempdir_factory)[0] == 0 assert _get_push_output(tempdir_factory)[0] == 0 with cwd(path2): install(C.CONFIG_FILE, store, hook_types=['pre-push']) assert _get_commit_output(tempdir_factory, msg='force!')[0] == 0 retc, output = _get_push_output(tempdir_factory, opts=('--force',)) > assert retc == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:583: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-push __________________________ test_pre_push_new_upstream __________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53d93e50> store = def test_pre_push_new_upstream(tempdir_factory, store): upstream = make_consuming_repo(tempdir_factory, 'script_hooks_repo') upstream2 = git_dir(tempdir_factory) path = tempdir_factory.get() cmd_output('git', 'clone', upstream, path) with cwd(path): install(C.CONFIG_FILE, store, hook_types=['pre-push']) assert _get_commit_output(tempdir_factory)[0] == 0 cmd_output('git', 'remote', 'rename', 'origin', 'upstream') cmd_output('git', 'remote', 'add', 'origin', upstream2) retc, output = _get_push_output(tempdir_factory) > assert retc == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:600: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-push _____________________ test_pre_push_integration_empty_push _____________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53ce7340> store = def test_pre_push_integration_empty_push(tempdir_factory, store): upstream = make_consuming_repo(tempdir_factory, 'script_hooks_repo') path = tempdir_factory.get() cmd_output('git', 'clone', upstream, path) with cwd(path): install(C.CONFIG_FILE, store, hook_types=['pre-push']) _get_push_output(tempdir_factory) retc, output = _get_push_output(tempdir_factory) > assert output == 'Everything up-to-date\n' E assert "`pre-commit`...on_empt0/2'\n" == 'Everything up-to-date\n' E + Everything up-to-date E - `pre-commit` not found. Did you forget to activate your virtualenv? E - error: failed to push some refs to '/tmp/pytest-of-mockbuild/pytest-2/test_pre_push_integration_empt0/2' tests/commands/install_uninstall_test.py:613: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-push _____________________________ test_pre_push_legacy _____________________________ tempdir_factory = .TmpdirFactory object at 0x7f6a53f399a0> store = def test_pre_push_legacy(tempdir_factory, store): upstream = make_consuming_repo(tempdir_factory, 'script_hooks_repo') path = tempdir_factory.get() cmd_output('git', 'clone', upstream, path) with cwd(path): mkdirp(os.path.join(path, '.git/hooks')) with io.open(os.path.join(path, '.git/hooks/pre-push'), 'w') as f: f.write( '#!/usr/bin/env bash\n' 'set -eu\n' 'read lr ls rr rs\n' 'test -n "$lr" -a -n "$ls" -a -n "$rr" -a -n "$rs"\n' 'echo legacy\n', ) make_executable(f.name) install(C.CONFIG_FILE, store, hook_types=['pre-push']) assert _get_commit_output(tempdir_factory)[0] == 0 retc, output = _get_push_output(tempdir_factory) > assert retc == 0 E assert 1 == 0 E -1 E +0 tests/commands/install_uninstall_test.py:637: AssertionError ----------------------------- Captured stdout call ----------------------------- Running in migration mode with existing hooks at .git/hooks/pre-push.legacy Use -f to use only pre-commit. pre-commit installed at .git/hooks/pre-push _____________________ test_commit_msg_integration_failing ______________________ commit_msg_repo = '/tmp/pytest-of-mockbuild/pytest-2/test_commit_msg_integration_fa0/0' tempdir_factory = .TmpdirFactory object at 0x7f6a51c27160> store = def test_commit_msg_integration_failing( commit_msg_repo, tempdir_factory, store, ): install(C.CONFIG_FILE, store, hook_types=['commit-msg']) retc, out = _get_commit_output(tempdir_factory) assert retc == 1 > assert out.startswith('Must have "Signed off by:"...') E assert False E + where False = ('Must have "Signed off by:"...') E + where = '`pre-commit` not found. Did you forget to activate your virtualenv?\n'.startswith /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/install_uninstall_test.py:650: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/commit-msg _____________________ test_commit_msg_integration_passing ______________________ commit_msg_repo = '/tmp/pytest-of-mockbuild/pytest-2/test_commit_msg_integration_pa0/0' tempdir_factory = .TmpdirFactory object at 0x7f6a53d2ef70> store = def test_commit_msg_integration_passing( commit_msg_repo, tempdir_factory, store, ): install(C.CONFIG_FILE, store, hook_types=['commit-msg']) msg = 'Hi\nSigned off by: me, lol' retc, out = _get_commit_output(tempdir_factory, msg=msg) > assert retc == 0 E assert 1 == 0 E -1 E +0 /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/install_uninstall_test.py:660: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/commit-msg ____________________________ test_commit_msg_legacy ____________________________ commit_msg_repo = '/tmp/pytest-of-mockbuild/pytest-2/test_commit_msg_legacy0/0' tempdir_factory = .TmpdirFactory object at 0x7f6a53cd4fa0> store = def test_commit_msg_legacy(commit_msg_repo, tempdir_factory, store): hook_path = os.path.join(commit_msg_repo, '.git/hooks/commit-msg') mkdirp(os.path.dirname(hook_path)) with io.open(hook_path, 'w') as hook_file: hook_file.write( '#!/usr/bin/env bash\n' 'set -eu\n' 'test -e "$1"\n' 'echo legacy\n', ) make_executable(hook_path) install(C.CONFIG_FILE, store, hook_types=['commit-msg']) msg = 'Hi\nSigned off by: asottile' retc, out = _get_commit_output(tempdir_factory, msg=msg) > assert retc == 0 E assert 1 == 0 E -1 E +0 /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/install_uninstall_test.py:682: AssertionError ----------------------------- Captured stdout call ----------------------------- Running in migration mode with existing hooks at .git/hooks/commit-msg.legacy Use -f to use only pre-commit. pre-commit installed at .git/hooks/commit-msg _________________ test_prepare_commit_msg_integration_failing __________________ failing_prepare_commit_msg_repo = '/tmp/pytest-of-mockbuild/pytest-2/test_prepare_commit_msg_integr0/0' tempdir_factory = .TmpdirFactory object at 0x7f6a53d9edf0> store = def test_prepare_commit_msg_integration_failing( failing_prepare_commit_msg_repo, tempdir_factory, store, ): install(C.CONFIG_FILE, store, hook_types=['prepare-commit-msg']) retc, out = _get_commit_output(tempdir_factory) assert retc == 1 > assert out.startswith('Add "Signed off by:"...') E assert False E + where False = ('Add "Signed off by:"...') E + where = '`pre-commit` not found. Did you forget to activate your virtualenv?\n'.startswith /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/install_uninstall_test.py:694: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/prepare-commit-msg _________________ test_prepare_commit_msg_integration_passing __________________ prepare_commit_msg_repo = '/tmp/pytest-of-mockbuild/pytest-2/test_prepare_commit_msg_integr1/0' tempdir_factory = .TmpdirFactory object at 0x7f6a53cb25e0> store = def test_prepare_commit_msg_integration_passing( prepare_commit_msg_repo, tempdir_factory, store, ): install(C.CONFIG_FILE, store, hook_types=['prepare-commit-msg']) msg = 'Hi' retc, out = _get_commit_output(tempdir_factory, msg=msg) > assert retc == 0 E assert 1 == 0 E -1 E +0 /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/install_uninstall_test.py:704: AssertionError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/prepare-commit-msg ________________________ test_prepare_commit_msg_legacy ________________________ prepare_commit_msg_repo = '/tmp/pytest-of-mockbuild/pytest-2/test_prepare_commit_msg_legacy0/0' tempdir_factory = .TmpdirFactory object at 0x7f6a53c8b5e0> store = def test_prepare_commit_msg_legacy( prepare_commit_msg_repo, tempdir_factory, store, ): hook_path = os.path.join( prepare_commit_msg_repo, '.git/hooks/prepare-commit-msg', ) mkdirp(os.path.dirname(hook_path)) with io.open(hook_path, 'w') as hook_file: hook_file.write( '#!/usr/bin/env bash\n' 'set -eu\n' 'test -e "$1"\n' 'echo legacy\n', ) make_executable(hook_path) install(C.CONFIG_FILE, store, hook_types=['prepare-commit-msg']) msg = 'Hi' retc, out = _get_commit_output(tempdir_factory, msg=msg) > assert retc == 0 E assert 1 == 0 E -1 E +0 /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/install_uninstall_test.py:735: AssertionError ----------------------------- Captured stdout call ----------------------------- Running in migration mode with existing hooks at .git/hooks/prepare-commit-msg.legacy Use -f to use only pre-commit. pre-commit installed at .git/hooks/prepare-commit-msg ______________________________ test_lots_of_files ______________________________ store = tempdir_factory = .TmpdirFactory object at 0x7f6a53e59e80> def test_lots_of_files(store, tempdir_factory): # windows xargs seems to have a bug, here's a regression test for # our workaround git_path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') with cwd(git_path): # Override files so we run against them with modify_config() as config: config['repos'][0]['hooks'][0]['files'] = '' # Write a crap ton of files for i in range(400): filename = '{}{}'.format('a' * 100, i) open(filename, 'w').close() cmd_output('git', 'add', '.') install(C.CONFIG_FILE, store, hook_types=['pre-commit']) > git_commit( fn=cmd_output_mocked_pre_commit_home, # git commit puts pre-commit to stderr stderr=subprocess.STDOUT, tempdir_factory=tempdir_factory, ) tests/commands/run_test.py:561: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ testing/util.py:144: in git_commit return fn(*cmd, **kwargs) testing/util.py:29: in cmd_output_mocked_pre_commit_home return cmd_output(*args, env=env, **kwargs) pre_commit/util.py:154: in cmd_output returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/git', 'commit', '--allow-empty', '--no-gpg-sign', '-a', '-m', ...) kwargs = {'env': {'CONFIG_SITE': 'NONE', 'GIT_AUTHOR_DATE': '2007-01-01 00:00:00 +0000', 'GIT_AUTHOR_EMAIL': 'test@example.org', 'GIT_AUTHOR_NAME': 'test', ...}, 'stderr': -2, 'stdin': -1, 'stdout': -1} retcode = 0, returncode = 1 stdout_b = b'`pre-commit` not found. Did you forget to activate your virtualenv?\n' stderr_b = None, proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/git', 'commit', '--allow-empty', '--no-gpg-sign', '-a', '-m', 'commit!') E Return code: 1 E Expected return code: 0 E Output: E `pre-commit` not found. Did you forget to activate your virtualenv? E E Errors: (none) pre_commit/util.py:146: CalledProcessError ----------------------------- Captured stdout call ----------------------------- pre-commit installed at .git/hooks/pre-commit _________________________________ test_stages __________________________________ cap_out = store = repo_with_passing_hook = '/tmp/pytest-of-mockbuild/pytest-2/test_stages0/2' def test_stages(cap_out, store, repo_with_passing_hook): config = { 'repo': 'local', 'hooks': [ { 'id': 'do-not-commit-{}'.format(i), 'name': 'hook {}'.format(i), 'entry': 'DO NOT COMMIT', 'language': 'pygrep', 'stages': [stage], } for i, stage in enumerate( ( 'commit', 'push', 'manual', 'prepare-commit-msg', 'commit-msg', ), 1, ) ], } add_config_to_repo(repo_with_passing_hook, config) stage_a_file() def _run_for_stage(stage): args = run_opts(hook_stage=stage) ret, printed = _do_run(cap_out, store, repo_with_passing_hook, args) assert not ret, (ret, printed) # this test should only run one hook assert printed.count(b'hook ') == 1 return printed > assert _run_for_stage('commit').startswith(b'hook 1...') /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/run_test.py:600: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ stage = 'commit' def _run_for_stage(stage): args = run_opts(hook_stage=stage) ret, printed = _do_run(cap_out, store, repo_with_passing_hook, args) > assert not ret, (ret, printed) E AssertionError: (1, b"hook 1...................................................................Failed E hookid: do-not-commit-1 E E /usr...inding module specification for 'pre_commit.languages.pygrep' (ModuleNotFoundError: No module named 'pre_commit') E E ") E assert not 1 /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/run_test.py:595: AssertionError ____________________________ test_local_hook_passes ____________________________ cap_out = store = repo_with_passing_hook = '/tmp/pytest-of-mockbuild/pytest-2/test_local_hook_passes0/2' def test_local_hook_passes(cap_out, store, repo_with_passing_hook): config = { 'repo': 'local', 'hooks': [ { 'id': 'identity-copy', 'name': 'identity-copy', 'entry': '{} -m pre_commit.meta_hooks.identity'.format( pipes.quote(sys.executable), ), 'language': 'system', 'files': r'\.py$', }, { 'id': 'do_not_commit', 'name': 'Block if "DO NOT COMMIT" is found', 'entry': 'DO NOT COMMIT', 'language': 'pygrep', }, ], } add_config_to_repo(repo_with_passing_hook, config) with io.open('dummy.py', 'w') as staged_file: staged_file.write('"""TODO: something"""\n') cmd_output('git', 'add', 'dummy.py') > _test_run( cap_out, store, repo_with_passing_hook, opts={}, expected_outputs=[b''], expected_ret=0, stage=False, ) /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/run_test.py:669: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cap_out = store = repo = '/tmp/pytest-of-mockbuild/pytest-2/test_local_hook_passes0/2', opts = {} expected_outputs = [b''], expected_ret = 0, stage = False config_file = '.pre-commit-config.yaml' def _test_run( cap_out, store, repo, opts, expected_outputs, expected_ret, stage, config_file=C.CONFIG_FILE, ): if stage: stage_a_file() args = run_opts(**opts) ret, printed = _do_run(cap_out, store, repo, args, config_file=config_file) > assert ret == expected_ret, (ret, expected_ret, printed) E AssertionError: (1, 0, b'identity-copy............................................................Failed E hookid: identity-copy E E /us...ng module specification for \'pre_commit.languages.pygrep\' (ModuleNotFoundError: No module named \'pre_commit\') E E ') E assert 1 == 0 E -1 E +0 /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/run_test.py:83: AssertionError __________________________ test_files_running_subdir ___________________________ repo_with_passing_hook = '/tmp/pytest-of-mockbuild/pytest-2/test_files_running_subdir0/1' tempdir_factory = .TmpdirFactory object at 0x7f6a53dd2160> def test_files_running_subdir(repo_with_passing_hook, tempdir_factory): with cwd(repo_with_passing_hook): os.mkdir('subdir') open('subdir/foo.py', 'w').close() cmd_output('git', 'add', 'subdir/foo.py') with cwd('subdir'): # Use subprocess to demonstrate behaviour in main > _, stdout, _ = cmd_output_mocked_pre_commit_home( sys.executable, '-m', 'pre_commit.main', 'run', '-v', # Files relative to where we are (#339) '--files', 'foo.py', tempdir_factory=tempdir_factory, ) /builddir/build/BUILD/pre-commit-1.20.0/tests/commands/run_test.py:780: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /builddir/build/BUILD/pre-commit-1.20.0/testing/util.py:29: in cmd_output_mocked_pre_commit_home return cmd_output(*args, env=env, **kwargs) /builddir/build/BUILD/pre-commit-1.20.0/pre_commit/util.py:154: in cmd_output returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cmd = ('/usr/bin/python3', '-m', 'pre_commit.main', 'run', '-v', '--files', ...) kwargs = {'env': {'CONFIG_SITE': 'NONE', 'GIT_AUTHOR_DATE': '2007-01-01 00:00:00 +0000', 'GIT_AUTHOR_EMAIL': 'test@example.org', 'GIT_AUTHOR_NAME': 'test', ...}, 'stderr': -1, 'stdin': -1, 'stdout': -1} retcode = 0, returncode = 1, stdout_b = b'' stderr_b = b"/usr/bin/python3: Error while finding module specification for 'pre_commit.main' (ModuleNotFoundError: No module named 'pre_commit')\n" proc = def cmd_output_b(*cmd, **kwargs): retcode = kwargs.pop('retcode', 0) cmd, kwargs = _cmd_kwargs(*cmd, **kwargs) try: cmd = parse_shebang.normalize_cmd(cmd) except parse_shebang.ExecutableNotFoundError as e: returncode, stdout_b, stderr_b = e.to_output() else: proc = subprocess.Popen(cmd, **kwargs) stdout_b, stderr_b = proc.communicate() returncode = proc.returncode if retcode is not None and retcode != returncode: > raise CalledProcessError( returncode, cmd, retcode, output=(stdout_b, stderr_b), ) E pre_commit.util.CalledProcessError: Command: ('/usr/bin/python3', '-m', 'pre_commit.main', 'run', '-v', '--files', 'foo.py') E Return code: 1 E Expected return code: 0 E Output: (none) E Errors: E /usr/bin/python3: Error while finding module specification for 'pre_commit.main' (ModuleNotFoundError: No module named 'pre_commit') /builddir/build/BUILD/pre-commit-1.20.0/pre_commit/util.py:146: CalledProcessError _________________________ test_healthy_types_py_in_cwd _________________________ tmpdir = local('/tmp/pytest-of-mockbuild/pytest-2/test_healthy_types_py_in_cwd0') def test_healthy_types_py_in_cwd(tmpdir): with tmpdir.as_cwd(): # even if a `types.py` file exists, should still be healthy tmpdir.join('types.py').ensure() # this env doesn't actually exist (for test speed purposes) > assert python.healthy(Prefix(str(tmpdir)), C.DEFAULT) is True E AssertionError: assert False is True E + where False = .healthy at 0x7f6a54c441f0>(Prefix(prefix_dir='/tmp/pytest-of-mockbuild/pytest-2/test_healthy_types_py_in_cwd0'), 'default') E + where .healthy at 0x7f6a54c441f0> = python.healthy E + and Prefix(prefix_dir='/tmp/pytest-of-mockbuild/pytest-2/test_healthy_types_py_in_cwd0') = Prefix('/tmp/pytest-of-mockbuild/pytest-2/test_healthy_types_py_in_cwd0') E + where '/tmp/pytest-of-mockbuild/pytest-2/test_healthy_types_py_in_cwd0' = str(local('/tmp/pytest-of-mockbuild/pytest-2/test_healthy_types_py_in_cwd0')) E + and 'default' = C.DEFAULT tests/languages/python_test.py:60: AssertionError ========= 68 failed, 534 passed, 6 skipped, 2 error in 261.69 seconds ========== error: Bad exit status from /var/tmp/rpm-tmp.vA0jmr (%check) Bad exit status from /var/tmp/rpm-tmp.vA0jmr (%check) RPM build errors: Child return code was: 1 EXCEPTION: [Error()] Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/mockbuild/trace_decorator.py", line 95, in trace result = func(*args, **kw) File "/usr/lib/python3.7/site-packages/mockbuild/util.py", line 746, in do_with_status raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) mockbuild.exception.Error: Command failed: # bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/originals/pre-commit.spec