0s autopkgtest: DBG: testbed init 0s autopkgtest [04:29:28]: starting date and time: 2025-02-19 04:29:28+0000 0s autopkgtest [04:29:28]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 0s autopkgtest [04:29:28]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.07z5cnd3/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python-click --apt-upgrade sqlfluff --debug --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=python-click/8.2.0-1 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest-s390x --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@bos03-s390x-6.secgroup --name adt-plucky-s390x-sqlfluff-20250219-042927-juju-7f2275-prod-proposed-migration-environment-15-f24abb4b-df01-447f-8bf7-0e240a14ddc5 --image adt/ubuntu-plucky-s390x-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration-s390x -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com,radosgw.ps5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 0s autopkgtest: DBG: got reply from testbed: ok 0s autopkgtest: DBG: testbed open, scratch=None 0s autopkgtest: DBG: sending command to testbed: open 101s autopkgtest: DBG: got reply from testbed: ok /tmp/autopkgtest.gvzmUI 101s autopkgtest: DBG: sending command to testbed: print-execute-command 101s autopkgtest: DBG: got reply from testbed: ok /tmp/autopkgtest-ssh.7_5xubr6/runcmd 101s autopkgtest: DBG: sending command to testbed: capabilities 101s autopkgtest: DBG: got reply from testbed: ok reboot isolation-machine suggested-normal-user=ubuntu revert-full-system revert root-on-testbed 101s autopkgtest: DBG: testbed capabilities: ['reboot', 'isolation-machine', 'suggested-normal-user=ubuntu', 'revert-full-system', 'revert', 'root-on-testbed', 'has_internet'] 101s autopkgtest: DBG: testbed command ['mkdir', '-p', '/tmp/autopkgtest.gvzmUI'], kind short, sout raw, serr pipe, env [] 101s autopkgtest: DBG: testbed command exited with code 0 101s autopkgtest: DBG: sending command to testbed: copydown /home/ubuntu/autopkgtest/lib/in-testbed/wrapper.sh /tmp/autopkgtest.gvzmUI/wrapper.sh 101s autopkgtest: DBG: got reply from testbed: ok 101s autopkgtest: DBG: testbed command ['chmod', '-R', '0755', '--', '/tmp/autopkgtest.gvzmUI/wrapper.sh'], kind short, sout raw, serr pipe, env [] 101s autopkgtest: DBG: testbed command exited with code 0 101s autopkgtest: DBG: testbed command ['dpkg', '--print-architecture'], kind short, sout pipe, serr pipe, env [] 101s autopkgtest: DBG: testbed command exited with code 0 101s autopkgtest [04:31:09]: testbed dpkg architecture: s390x 101s autopkgtest: DBG: testbed command ['dpkg-query', '-W', '-f', '${Version}', 'apt'], kind short, sout pipe, serr pipe, env [] 102s autopkgtest: DBG: testbed command exited with code 0 102s autopkgtest [04:31:10]: testbed apt version: 2.9.29 102s autopkgtest: DBG: testbed command ['sh', '-ec', 'command -v eatmydata'], kind short, sout pipe, serr pipe, env [] 102s autopkgtest: DBG: testbed command exited with code 0 102s autopkgtest: DBG: testbed has eatmydata 102s autopkgtest: DBG: testbed command ['mkdir', '-p', '/etc/apt/preferences.d'], kind short, sout raw, serr pipe, env [] 102s autopkgtest: DBG: testbed command exited with code 0 102s autopkgtest [04:31:10]: @@@@@@@@@@@@@@@@@@@@ test bed setup 102s autopkgtest: DBG: testbed command ['sh', '-ec', '#!/bin/sh\n# Copyright © 2006-2018 Canonical Ltd.\n# Copyright © 2015-2017 Martin Pitt\n# Copyright © 2017 Steve Langasek\n# Copyright © 2017-2022 Paul Gevers\n# Copyright © 2018 Simon McVittie\n# SPDX-License-Identifier: GPL-2.0-or-later\n\n# This script returns the first suite found in apt sources. We can\'t just rely\n# on /etc/os-release because it doesn\'t allow to distinguish between Debian\n# unstable and testing.\n#\n# This release detection logic should be kept in sync with similar code in the\n# setup-testbed script.\n#\n# For more information on APT data sources see sources.list(5).\n\n# Usage $0\n\nset -eux\n\ndistro=UNKNOWN\nif [ -r /etc/os-release ]; then\n # shellcheck disable=SC1091\n distro=$(. /etc/os-release && echo "${ID:-$distro}")\nfi\n\n# Try guessing the default release from deb822-style format sources.\n#\n# While not mandatory, APT upstream expects distros to follow the\n# .sources naming pattern for the default deb822 sources.\napt_sources="/etc/apt/sources.list.d/$distro.sources"\nif [ -r "$apt_sources" ]; then\n release=$(sed -En \'s/^Suites:\\s*(\\w+).*/\\1/Ip\' "$apt_sources" | head -n1)\n [ -n "$release" ] && echo "$release" && exit\nfi\n\n# Try guessing the default release from one-line-style format sources.\napt_sources=/etc/apt/sources.list\nif [ -r "$apt_sources" ]; then\n release=$(sed -En \'/^(deb|deb-src) +(\\[.*\\] *)?(http|https|file):/ { s/\\[.*\\] +//; s/^[^ ]+ +[^ ]* +([^ ]+) +.*$/\\1/p }\' "$apt_sources" | head -n1)\n [ -n "$release" ] && echo "$release" && exit\nfi\n\n# Could not guess the default release\necho "Could not guess the default release from the APT sources." >&2\nexit 1\n'], kind short, sout pipe, serr pipe, env [] 102s autopkgtest: DBG: testbed command exited with code 0 102s autopkgtest [04:31:10]: testbed release detected to be: None 102s autopkgtest: DBG: testbed command ['sh', '-ec', '#!/bin/sh\n# SPDX-License-Identifier: GPL-2.0-or-later\n\n# This script returns the list of configured "deb" sources in one-line-style\n# source lists (/etc/apt/sources.list, /etc/apt/sources.list.d/*.list).\n# See sources.list(5) for more information on the APT source list formats.\n#\n# This script takes no arguments.\n\nset -eu\n\n# grep(1) returns 1 if no lines were selected from the input files, which\n# can happen if there are .list files, but they contain no "deb" entries.\n# We don\'t want to fail in this case, hence the "|| true", which we put\n# in a subshell because we want it to affect only the grep invocation.\n{\n if [ -f /etc/apt/sources.list ]; then\n printf \'%s\\0\' /etc/apt/sources.list\n fi\n if [ -d /etc/apt/sources.list.d ]; then\n find /etc/apt/sources.list.d -maxdepth 1 -type f -regex \'.*/[a-zA-Z0-9_.-]+\\.list\' -print0 \\\n | LC_ALL=C sort --zero-terminated\n fi\n} | xargs -0 --no-run-if-empty -- sh -c \'grep -h "^deb " "$@" || true\' "$(basename "$0")"\n'], kind short, sout pipe, serr pipe, env [] 102s autopkgtest: DBG: testbed command exited with code 0 102s autopkgtest: DBG: testbed command ['sh', '-ec', '#!/bin/sh\n# SPDX-License-Identifier: GPL-2.0-or-later\n\n# This script returns the list of configured sources in deb822-style source\n# lists (/etc/apt/sources.list.d/*.sources). Sources are not stripped out of\n# comments, extra blank lines or similar: the output of this script is meant to\n# be consumed by a deb822 parser that is able to correctly handle those.\n# See sources.list(5) for more information on the APT source list formats.\n#\n# This script takes no arguments.\n\nset -eu\n\n# Awk concatenates files making sure stanzas from separate files are separated\n# by a blank line, even if there are no newlines at EOF in the .sources files.\nif [ -d /etc/apt/sources.list.d ]; then\n find /etc/apt/sources.list.d -maxdepth 1 -type f -regex \'.*/[a-zA-Z0-9_.-]+\\.sources\' -print0 \\\n | LC_ALL=C sort --zero-terminated \\\n | xargs -0 --no-run-if-empty -- awk \'FNR == 1 && NR != 1 { print "" } { print }\'\nfi\n'], kind short, sout pipe, serr pipe, env [] 102s autopkgtest: DBG: testbed command exited with code 0 102s autopkgtest: DBG: adding APT source: Types: deb deb-src 102s URIs: http://ftpmaster.internal/ubuntu/ 102s Suites: plucky-proposed 102s Components: main restricted universe multiverse 102s Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg 102s autopkgtest: DBG: testbed command ['sh', '-ec', '"$@" >> "/etc/apt/sources.list.d/autopkgtest-add-apt-release-plucky-proposed.sources"', 'add_apt_source', 'printf', '%s\\n', 'Types: deb deb-src\nURIs: http://ftpmaster.internal/ubuntu/\nSuites: plucky-proposed\nComponents: main restricted universe multiverse\nSigned-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg\n'], kind short, sout raw, serr pipe, env [] 103s autopkgtest: DBG: testbed command exited with code 0 103s autopkgtest: DBG: adding APT preference to autopkgtest-zz-plucky-proposed-baseline.pref: 103s Package: * 103s Pin: release plucky-proposed 103s Pin-Priority: 500 103s autopkgtest: DBG: testbed command ['sh', '-ec', '"$@" > "/etc/apt/preferences.d/autopkgtest-zz-plucky-proposed-baseline.pref"', 'add_apt_preference', 'printf', '%s\\n', 'Package: *\nPin: release plucky-proposed\nPin-Priority: 500'], kind short, sout raw, serr pipe, env [] 103s autopkgtest: DBG: testbed command exited with code 0 103s autopkgtest [04:31:11]: updating testbed package index (apt update) 103s autopkgtest: DBG: testbed command ['/bin/sh', '-ec', '"$@" 3>&2 2>&1', 'run_apt_command', '/usr/bin/eatmydata', 'apt-get', '--quiet', '--assume-yes', '-o=APT::Status-Fd=3', '-o=APT::Install-Recommends=false', '-o=Dpkg::Options::=--force-confnew', '-o=Debug::pkgProblemResolver=true', 'update'], kind install, sout raw, serr pipe, env ['DEBIAN_FRONTEND=noninteractive', 'APT_LISTBUGS_FRONTEND=none', 'APT_LISTCHANGES_FRONTEND=none'] 103s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [110 kB] 103s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 103s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 103s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 104s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [14.6 kB] 104s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [788 kB] 104s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [79.1 kB] 104s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [3120 B] 104s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x Packages [98.8 kB] 104s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted s390x Packages [760 B] 104s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe s390x Packages [656 kB] 104s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse s390x Packages [5192 B] 104s Fetched 1755 kB in 1s (1765 kB/s) 105s Reading package lists... 105s autopkgtest: DBG: testbed command exited with code 0 105s autopkgtest: DBG: adding APT preference to autopkgtest-plucky-proposed.pref: 105s Package: * 105s Pin: release plucky-proposed 105s Pin-Priority: 100 105s 105s Package: src:python-click:any 105s Pin: release plucky-proposed 105s Pin-Priority: 995 105s autopkgtest: DBG: testbed command ['sh', '-ec', '"$@" > "/etc/apt/preferences.d/autopkgtest-plucky-proposed.pref"', 'add_apt_preference', 'printf', '%s\\n', 'Package: *\nPin: release plucky-proposed\nPin-Priority: 100\n\nPackage: src:python-click:any\nPin: release plucky-proposed\nPin-Priority: 995'], kind short, sout raw, serr pipe, env [] 105s autopkgtest: DBG: testbed command exited with code 0 105s autopkgtest: DBG: testbed command ['bash', '-ec', 'for d in /boot /boot/efi /boot/grub /etc/init /etc/init.d /etc/systemd/system /lib/systemd/system; do [ ! -d $d ] || touch -r $d /tmp/autopkgtest.gvzmUI/${d//\\//_}.stamp; done'], kind short, sout raw, serr pipe, env [] 105s autopkgtest: DBG: testbed command exited with code 0 105s autopkgtest: DBG: testbed command ['sh', '-ec', '#!/bin/sh\n# Canonical/Ubuntu specific testbed setup\n\nset -x\n\nRELEASE=$(lsb_release --codename --short 2>/dev/null)\n\n# Make the installed package versions match what is available from the configured\n# repositories, even if a downgrade is required.\n#\n# We may end up with images with packages newer than those available from the\n# repositories when opening a new release (images are created using the\n# previous release dailies as a base, which may include 0-day SRUs, or\n# Launchpad may fail to copy packages, see openssl 3.0.8-1ubuntu2), or when\n# package versions are pulled from the archive.\n#\n# Note: \'release a=\' matches the Suite field in the repository Release file.\ncat >/etc/apt/preferences.d/force-downgrade-to-release.pref <= Focal).\n#\n# Note: autoremove/--autoremove always runs on the entire set of installed\n# packages. Together with --autopurge/purge each removal becomes a purge.\n#\n# Removing \'?obsolete\' packages may remove the running kernel. This is not\n# expected to be an issue.\nif /usr/lib/apt/apt-helper analyze-pattern \'?true\' >/dev/null 2>&1; then\n # DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y purge --autoremove \'?obsolete\'\n # Avoid removing the running kernel\n running_kernel_pattern="^linux-.*$(uname -r | sed \'s/\\./\\\\./g\').*"\n obsolete_pkgs="$(apt list \'?obsolete\' 2>/dev/null \\\n | tail -n+2 \\\n | cut -d\'/\' -f1 \\\n | grep -v "${running_kernel_pattern}" || true)"\n DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y purge --autoremove ${obsolete_pkgs}\nelse\n # We\'re on an older release (analyze-pattern is not available).\n # Still do an autopurge to get rid of packages that got orphaned\n # by downgrades.\n eatmydata apt-get -y autoremove --purge\nfi\n\n# compatibility with old Jenkins testbeds for trusty\nif grep -q trusty /etc/lsb-release; then apt-get update || (sleep 10; apt-get update); apt-get install -y build-essential; fi\n\n# these packages really break tests, purge them if we use standard cloud images\n# (on lcy01)\nfor p in unattended-upgrades lxd lxd-client snapd; do\n [ ! -d /usr/share/doc/$p ] || $(which eatmydata || true) apt-get purge --auto-remove -y $p\ndone\n\nif type iptables >/dev/null 2>&1; then\n cat < /etc/rc.local\n#!/bin/sh\n\n# work around broken PTMU; LP: #1572026, RT#90771\niptables -w -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu || true\n\n# These addresses are used at least by rust-reqwest and should not be reachable\n# See https://bugs.launchpad.net/ubuntu/+source/rust-reqwest/+bug/2080346\niptables -A OUTPUT -d 10.255.255.1/32 -p tcp -j DROP || true\niptables -A OUTPUT -d 10.255.255.2/32 -p tcp -j DROP || true\nEOF\n chmod 755 /etc/rc.local\n # shellcheck disable=SC1091\n . /etc/rc.local\nfi\n\n# work around broken tty on ppc64el instances (LP: #1607075)\nif [ "$(uname -m)" = ppc64le ] && [ "$(systemctl is-active keyboard-setup.service 2>/dev/null|| true)" = failed ]; then\n systemctl reset-failed keyboard-setup.service\n systemctl mask keyboard-setup.service\nfi\n\n# work around late urandom pool initialization (LP: #1622893)\nif [ -d /run/systemd/system ] && systemd-detect-virt --quiet --vm; then\n mkdir -p /etc/systemd/system/systemd-random-seed.service.d/\n cat < /etc/systemd/system/systemd-random-seed.service.d/fakeentropy.conf\n[Service]\nExecStart=/usr/bin/perl -E \'open \\$\\$f, "/bin/bash" or die; open \\$\\$rnd, ">/dev/random" or die; for (\\$\\$i = 0; \\$\\$i < 10; ++\\$\\$i) {read \\$\\$f, \\$\\$d, 64; ioctl \\$\\$rnd, 0x40085203, pack("ii", 64*8, 64) . \\$\\$d}\'\nEOF\nfi\n\n# set compressor to lz4 where supported, we care about compression speed\nif grep -q lz4 /etc/initramfs-tools/initramfs.conf; then\n echo COMPRESS=lz4 > /etc/initramfs-tools/conf.d/lz4\nfi'], kind install, sout raw, serr raw, env ['AUTOPKGTEST_IS_SETUP_COMMAND=1', 'AUTOPKGTEST_NORMAL_USER=ubuntu', 'ADT_NORMAL_USER=ubuntu'] 105s + lsb_release --codename --short 105s + RELEASE=plucky 105s + cat 105s + [ plucky != trusty ] 105s + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y --allow-downgrades -o Dpkg::Options::=--force-confnew dist-upgrade 105s Reading package lists... 105s Building dependency tree... 105s Reading state information... 106s Calculating upgrade... 106s The following packages were automatically installed and are no longer required: 106s libnsl2 libpython3.12-minimal libpython3.12-stdlib libpython3.12t64 106s linux-headers-6.11.0-8 linux-headers-6.11.0-8-generic 106s linux-modules-6.11.0-8-generic linux-tools-6.11.0-8 106s linux-tools-6.11.0-8-generic 106s Use 'sudo apt autoremove' to remove them. 106s The following packages will be upgraded: 106s dhcpcd-base s390-tools s390-tools-data s390-tools-signed 106s 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 106s Need to get 5637 kB of archives. 106s After this operation, 54.3 kB of additional disk space will be used. 106s Get:1 http://ftpmaster.internal/ubuntu plucky/main s390x dhcpcd-base s390x 1:10.1.0-7 [219 kB] 106s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x s390-tools-data all 2.37.0-0ubuntu2 [20.4 kB] 106s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x s390-tools s390x 2.37.0-0ubuntu2 [5385 kB] 107s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x s390-tools-signed all 2.37.0-0ubuntu2 [12.4 kB] 107s Fetched 5637 kB in 1s (6582 kB/s) 107s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 80980 files and directories currently installed.) 107s Preparing to unpack .../dhcpcd-base_1%3a10.1.0-7_s390x.deb ... 107s Unpacking dhcpcd-base (1:10.1.0-7) over (1:10.1.0-6) ... 107s Preparing to unpack .../s390-tools-data_2.37.0-0ubuntu2_all.deb ... 107s Unpacking s390-tools-data (2.37.0-0ubuntu2) over (2.37.0-0ubuntu1) ... 107s Preparing to unpack .../s390-tools_2.37.0-0ubuntu2_s390x.deb ... 107s Unpacking s390-tools (2.37.0-0ubuntu2) over (2.37.0-0ubuntu1) ... 107s Preparing to unpack .../s390-tools-signed_2.37.0-0ubuntu2_all.deb ... 107s Unpacking s390-tools-signed (2.37.0-0ubuntu2) over (2.37.0-0ubuntu1) ... 107s Setting up s390-tools-signed (2.37.0-0ubuntu2) ... 107s Setting up dhcpcd-base (1:10.1.0-7) ... 107s Setting up s390-tools-data (2.37.0-0ubuntu2) ... 107s Setting up s390-tools (2.37.0-0ubuntu2) ... 108s Processing triggers for man-db (2.13.0-1) ... 109s Processing triggers for initramfs-tools (0.145ubuntu2) ... 109s update-initramfs: Generating /boot/initrd.img-6.12.0-15-generic 109s W: No lz4 in /usr/bin:/sbin:/bin, using gzip 114s Using config file '/etc/zipl.conf' 114s Building bootmap in '/boot' 114s Adding IPL section 'ubuntu' (default) 114s Preparing boot device for LD-IPL: vda (0000). 114s Done. 114s + rm /etc/apt/preferences.d/force-downgrade-to-release.pref 114s + /usr/lib/apt/apt-helper analyze-pattern ?true 114s + uname -r 114s + sed s/\./\\./g 114s + running_kernel_pattern=^linux-.*6\.12\.0-15-generic.* 114s + apt list ?obsolete 114s + tail -n+2 114s + cut -d/ -f1 114s + grep -v ^linux-.*6\.12\.0-15-generic.* 114s + true 114s + obsolete_pkgs= 114s + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y purge --autoremove 114s Reading package lists... 115s Building dependency tree... 115s Reading state information... 115s The following packages will be REMOVED: 115s libnsl2* libpython3.12-minimal* libpython3.12-stdlib* libpython3.12t64* 115s linux-headers-6.11.0-8* linux-headers-6.11.0-8-generic* 115s linux-modules-6.11.0-8-generic* linux-tools-6.11.0-8* 115s linux-tools-6.11.0-8-generic* 115s 0 upgraded, 0 newly installed, 9 to remove and 0 not upgraded. 115s After this operation, 167 MB disk space will be freed. 115s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 80981 files and directories currently installed.) 115s Removing linux-tools-6.11.0-8-generic (6.11.0-8.8) ... 115s Removing linux-tools-6.11.0-8 (6.11.0-8.8) ... 115s Removing libpython3.12t64:s390x (3.12.9-1) ... 115s Removing libpython3.12-stdlib:s390x (3.12.9-1) ... 115s Removing libnsl2:s390x (1.3.0-3build3) ... 115s Removing libpython3.12-minimal:s390x (3.12.9-1) ... 115s Removing linux-headers-6.11.0-8-generic (6.11.0-8.8) ... 116s Removing linux-headers-6.11.0-8 (6.11.0-8.8) ... 117s Removing linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 117s Processing triggers for libc-bin (2.40-4ubuntu1) ... 117s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55881 files and directories currently installed.) 117s Purging configuration files for libpython3.12-minimal:s390x (3.12.9-1) ... 117s Purging configuration files for linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 117s + grep -q trusty /etc/lsb-release 117s + [ ! -d /usr/share/doc/unattended-upgrades ] 117s + [ ! -d /usr/share/doc/lxd ] 117s + [ ! -d /usr/share/doc/lxd-client ] 117s + [ ! -d /usr/share/doc/snapd ] 117s + type iptables 117s + cat 117s + chmod 755 /etc/rc.local 117s + . /etc/rc.local 117s + iptables -w -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu 117s + iptables -A OUTPUT -d 10.255.255.1/32 -p tcp -j DROP 117s + iptables -A OUTPUT -d 10.255.255.2/32 -p tcp -j DROP 117s + uname -m 117s + [ s390x = ppc64le ] 117s + [ -d /run/systemd/system ] 117s + systemd-detect-virt --quiet --vm 117s + mkdir -p /etc/systemd/system/systemd-random-seed.service.d/ 117s + cat 117s + grep -q lz4 /etc/initramfs-tools/initramfs.conf 117s + echo COMPRESS=lz4 117s autopkgtest: DBG: testbed command exited with code 0 117s autopkgtest [04:31:25]: upgrading testbed (apt dist-upgrade and autopurge) 117s autopkgtest: DBG: testbed command ['/bin/sh', '-ec', '"$@" 3>&2 2>&1', 'run_apt_command', '/usr/bin/eatmydata', 'apt-get', '--quiet', '--assume-yes', '-o=APT::Status-Fd=3', '-o=APT::Install-Recommends=false', '-o=Dpkg::Options::=--force-confnew', '-o=Debug::pkgProblemResolver=true', 'dist-upgrade'], kind install, sout raw, serr pipe, env ['DEBIAN_FRONTEND=noninteractive', 'APT_LISTBUGS_FRONTEND=none', 'APT_LISTCHANGES_FRONTEND=none'] 117s Reading package lists... 117s Building dependency tree... 117s Reading state information... 117s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 117s Starting 2 pkgProblemResolver with broken count: 0 117s Done 118s Entering ResolveByKeep 118s 118s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 118s autopkgtest: DBG: testbed command exited with code 0 118s autopkgtest: DBG: testbed command ['/bin/sh', '-ec', '"$@" 3>&2 2>&1', 'run_apt_command', '/usr/bin/eatmydata', 'apt-get', '--quiet', '--assume-yes', '-o=APT::Status-Fd=3', '-o=APT::Install-Recommends=false', '-o=Dpkg::Options::=--force-confnew', '-o=Debug::pkgProblemResolver=true', '--purge', 'autoremove'], kind install, sout raw, serr pipe, env ['DEBIAN_FRONTEND=noninteractive', 'APT_LISTBUGS_FRONTEND=none', 'APT_LISTCHANGES_FRONTEND=none'] 118s Reading package lists... 118s Building dependency tree... 118s Reading state information... 118s Starting pkgProblemResolver with broken count: 0 118s Starting 2 pkgProblemResolver with broken count: 0 118s Done 119s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 119s autopkgtest: DBG: testbed command exited with code 0 119s autopkgtest: DBG: testbed command ['bash', '-ec', '[ ! -e /run/autopkgtest_no_reboot.stamp ] || exit 0;for d in /boot /boot/efi /boot/grub /etc/init /etc/init.d /etc/systemd/system /lib/systemd/system; do s=/tmp/autopkgtest.gvzmUI/${d//\\//_}.stamp; [ ! -d $d ] || [ `stat -c %Y $d` = `stat -c %Y $s` ]; done'], kind short, sout raw, serr raw, env [] 119s autopkgtest: DBG: testbed command exited with code 1 119s autopkgtest [04:31:27]: rebooting testbed after setup commands that affected boot 119s autopkgtest: DBG: sending command to testbed: reboot 133s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 138s autopkgtest: DBG: got reply from testbed: ok 138s autopkgtest: DBG: testbed supports reboot, creating /tmp/autopkgtest-reboot 138s autopkgtest: DBG: testbed command ['mkdir', '-p', '/tmp/autopkgtest.gvzmUI'], kind short, sout raw, serr pipe, env [] 138s autopkgtest: DBG: testbed command exited with code 0 138s autopkgtest: DBG: sending command to testbed: copydown /home/ubuntu/autopkgtest/lib/in-testbed/reboot.sh /tmp/autopkgtest.gvzmUI/autopkgtest-reboot 139s autopkgtest: DBG: got reply from testbed: ok 139s autopkgtest: DBG: testbed command ['chmod', '-R', '0755', '--', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot'], kind short, sout raw, serr pipe, env [] 139s autopkgtest: DBG: testbed command exited with code 0 139s autopkgtest: DBG: testbed command ['ln', '-fns', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot', '/tmp/autopkgtest-reboot'], kind short, sout raw, serr pipe, env [] 139s autopkgtest: DBG: testbed command exited with code 0 139s autopkgtest: DBG: testbed command ['ln', '-fns', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot', '/sbin/autopkgtest-reboot'], kind short, sout raw, serr pipe, env [] 139s autopkgtest: DBG: testbed command exited with code 0 139s autopkgtest: DBG: testbed command ['mkdir', '-p', '/tmp/autopkgtest.gvzmUI'], kind short, sout raw, serr pipe, env [] 139s autopkgtest: DBG: testbed command exited with code 0 139s autopkgtest: DBG: sending command to testbed: copydown /home/ubuntu/autopkgtest/lib/in-testbed/reboot-prepare.sh /tmp/autopkgtest.gvzmUI/autopkgtest-reboot-prepare 139s autopkgtest: DBG: got reply from testbed: ok 139s autopkgtest: DBG: testbed command ['chmod', '-R', '0755', '--', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot-prepare'], kind short, sout raw, serr pipe, env [] 140s autopkgtest: DBG: testbed command exited with code 0 140s autopkgtest: DBG: testbed command ['ln', '-fns', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot-prepare', '/tmp/autopkgtest-reboot-prepare'], kind short, sout raw, serr pipe, env [] 140s autopkgtest: DBG: testbed command exited with code 0 140s autopkgtest: DBG: testbed command ['uname', '-srv'], kind short, sout pipe, serr pipe, env [] 140s autopkgtest: DBG: testbed command exited with code 0 140s autopkgtest [04:31:48]: testbed running kernel: Linux 6.12.0-15-generic #15-Ubuntu SMP Tue Feb 4 15:05:57 UTC 2025 140s autopkgtest: DBG: testbed command ['sh', '-c', 'nproc; cat /proc/cpuinfo 2>/dev/null || true'], kind short, sout pipe, serr pipe, env [] 140s autopkgtest: DBG: testbed command exited with code 0 140s autopkgtest: DBG: testbed command ['sh', '-ec', "dpkg-query --show -f '${Package}\\t${Version}\\n' > /tmp/autopkgtest.gvzmUI/testbed-packages"], kind short, sout raw, serr pipe, env [] 140s autopkgtest: DBG: testbed command exited with code 0 140s autopkgtest: DBG: sending command to testbed: copyup /tmp/autopkgtest.gvzmUI/testbed-packages /tmp/autopkgtest-work.07z5cnd3/out/testbed-packages 140s autopkgtest: DBG: got reply from testbed: ok 140s autopkgtest: DBG: testbed supports reboot, creating /tmp/autopkgtest-reboot 140s autopkgtest: DBG: testbed command ['mkdir', '-p', '/tmp/autopkgtest.gvzmUI'], kind short, sout raw, serr pipe, env [] 141s autopkgtest: DBG: testbed command exited with code 0 141s autopkgtest: DBG: sending command to testbed: copydown /home/ubuntu/autopkgtest/lib/in-testbed/reboot.sh /tmp/autopkgtest.gvzmUI/autopkgtest-reboot 141s autopkgtest: DBG: got reply from testbed: ok 141s autopkgtest: DBG: testbed command ['chmod', '-R', '0755', '--', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot'], kind short, sout raw, serr pipe, env [] 141s autopkgtest: DBG: testbed command exited with code 0 141s autopkgtest: DBG: testbed command ['ln', '-fns', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot', '/tmp/autopkgtest-reboot'], kind short, sout raw, serr pipe, env [] 141s autopkgtest: DBG: testbed command exited with code 0 141s autopkgtest: DBG: testbed command ['ln', '-fns', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot', '/sbin/autopkgtest-reboot'], kind short, sout raw, serr pipe, env [] 141s autopkgtest: DBG: testbed command exited with code 0 141s autopkgtest: DBG: testbed command ['mkdir', '-p', '/tmp/autopkgtest.gvzmUI'], kind short, sout raw, serr pipe, env [] 141s autopkgtest: DBG: testbed command exited with code 0 141s autopkgtest: DBG: sending command to testbed: copydown /home/ubuntu/autopkgtest/lib/in-testbed/reboot-prepare.sh /tmp/autopkgtest.gvzmUI/autopkgtest-reboot-prepare 142s autopkgtest: DBG: got reply from testbed: ok 142s autopkgtest: DBG: testbed command ['chmod', '-R', '0755', '--', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot-prepare'], kind short, sout raw, serr pipe, env [] 142s autopkgtest: DBG: testbed command exited with code 0 142s autopkgtest: DBG: testbed command ['ln', '-fns', '/tmp/autopkgtest.gvzmUI/autopkgtest-reboot-prepare', '/tmp/autopkgtest-reboot-prepare'], kind short, sout raw, serr pipe, env [] 142s autopkgtest: DBG: testbed command exited with code 0 142s autopkgtest: DBG: testbed command ['uname', '-srv'], kind short, sout pipe, serr pipe, env [] 142s autopkgtest: DBG: testbed command exited with code 0 142s autopkgtest: DBG: Binaries: initialising 142s autopkgtest [04:31:50]: @@@@@@@@@@@@@@@@@@@@ apt-source sqlfluff 142s autopkgtest: DBG: blame += sqlfluff 142s autopkgtest: DBG: testbed reset: modified=False, deps_installed=[], deps_new=[] 142s autopkgtest: DBG: testbed command ['apt-cache', 'showsrc', '--only-source', 'sqlfluff'], kind short, sout pipe, serr pipe, env [] 142s autopkgtest: DBG: testbed command exited with code 0 142s autopkgtest: DBG: testbed command ['apt-cache', 'policy', '^sqlfluff$'], kind short, sout pipe, serr raw, env [] 143s autopkgtest: DBG: testbed command exited with code 0 143s autopkgtest: DBG: testbed command ['apt-cache', 'show', 'sqlfluff=3.3.1-1'], kind short, sout pipe, serr raw, env [] 143s autopkgtest: DBG: testbed command exited with code 0 143s autopkgtest: DBG: testbed command ['apt-cache', 'policy', '^sqlfluff-doc$'], kind short, sout pipe, serr raw, env [] 143s autopkgtest: DBG: testbed command exited with code 0 143s autopkgtest: DBG: testbed command ['apt-cache', 'show', 'sqlfluff-doc=3.3.1-1'], kind short, sout pipe, serr raw, env [] 143s autopkgtest: DBG: testbed command exited with code 0 143s autopkgtest: DBG: install_deps: deps_new=[] 143s autopkgtest: DBG: testbed command ['sh', '-ec', 'command -v dpkg-source'], kind short, sout pipe, serr pipe, env [] 143s autopkgtest: DBG: testbed command exited with code 0 143s autopkgtest: DBG: testbed command ['sh', '-ec', 'su --shell=/bin/sh ubuntu -c \'set -e; exec 3>&1 >&2; set -x; cd /; builddir=$(mktemp -d /tmp/autopkgtest.gvzmUI/build.XXX); cd $builddir; OUT=$(apt-get source -d -q --only-source sqlfluff=3.3.1-1 2>&1) || RC=$?;if [ -n "$RC" ]; then if echo "$OUT" | grep -q "Unable to find a source package"; then exit 1; else exit $RC; fi;fi;echo "$OUT" | grep ^Get: || true;dpkg-source -x sqlfluff_*.dsc src >/dev/null; chmod -R a+rX .; cd [a-z0-9]*/.; pwd >&3; sed -n "1 {s/).*//; s/ (/\\n/; p}" debian/changelog >&3\''], kind build, sout pipe, serr raw, env ['ADT_TEST_TRIGGERS=python-click/8.2.0-1'] 144s + cd / 144s + mktemp -d /tmp/autopkgtest.gvzmUI/build.XXX 144s + builddir=/tmp/autopkgtest.gvzmUI/build.Jwf 144s + cd /tmp/autopkgtest.gvzmUI/build.Jwf 144s + apt-get source -d -q --only-source sqlfluff=3.3.1-1 145s + OUT=Reading package lists... 145s NOTICE: 'sqlfluff' packaging is maintained in the 'Git' version control system at: 145s https://salsa.debian.org/python-team/packages/sqlfluff.git 145s Please use: 145s git clone https://salsa.debian.org/python-team/packages/sqlfluff.git 145s to retrieve the latest (possibly unreleased) updates to the package. 145s Need to get 2974 kB of source archives. 145s Get:1 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (dsc) [3968 B] 145s Get:2 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (tar) [2961 kB] 145s Get:3 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (diff) [9076 B] 145s Fetched 2974 kB in 1s (3466 kB/s) 145s Download complete and in download only mode 145s + [ -n ] 145s + echo Reading package lists... 145s NOTICE: 'sqlfluff' packaging is maintained in the 'Git' version control system at: 145s https://salsa.debian.org/python-team/packages/sqlfluff.git 145s Please use: 145s git clone https://salsa.debian.org/python-team/packages/sqlfluff.git 145s to retrieve the latest (possibly unreleased) updates to the package. 145s Need to get 2974 kB of source archives. 145s Get:1 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (dsc) [3968 B] 145s Get:2 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (tar) [2961 kB] 145s Get:3 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (diff) [9076 B] 145s Fetched 2974 kB in 1s (3466 kB/s) 145s Download complete and in download only mode 145s + grep ^Get: 145s Get:1 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (dsc) [3968 B] 145s Get:2 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (tar) [2961 kB] 145s Get:3 http://ftpmaster.internal/ubuntu plucky/universe sqlfluff 3.3.1-1 (diff) [9076 B] 145s + dpkg-source -x sqlfluff_3.3.1-1.dsc src 145s gpgv: Signature made Sun Feb 9 16:45:26 2025 UTC 145s gpgv: using RSA key AC0A4FF12611B6FCCF01C111393587D97D86500B 145s gpgv: Can't check signature: No public key 145s dpkg-source: warning: cannot verify inline signature for ./sqlfluff_3.3.1-1.dsc: no acceptable signature found 145s + chmod -R a+rX . 145s + cd src/. 145s + pwd 145s + sed -n 1 {s/).*//; s/ (/\n/; p} debian/changelog 145s autopkgtest: DBG: testbed command exited with code 0 145s autopkgtest [04:31:53]: testing package sqlfluff version 3.3.1-1 145s autopkgtest: DBG: sending command to testbed: copyup /tmp/autopkgtest.gvzmUI/build.Jwf/src/debian/ /tmp/autopkgtest-work.07z5cnd3/out/pkg/debian/ 145s autopkgtest: DBG: got reply from testbed: ok 145s autopkgtest: DBG: autodep8 generated control: ----- 145s Tests: upstream 145s Depends: 145s python3-all, 145s python3-hypothesis, 145s python3-pytest, 145s sqlfluff, 145s Restrictions: allow-stderr 145s 145s 145s 145s ------- 145s autopkgtest: DBG: processing dependency python3-all 145s autopkgtest: DBG: processing dependency python3-hypothesis 145s autopkgtest: DBG: processing dependency python3-pytest 145s autopkgtest: DBG: processing dependency sqlfluff 145s autopkgtest: DBG: marked alternatives ['sqlfluff'] as a synthesised dependency 145s autopkgtest: DBG: Test defined: name upstream path debian/tests/upstream command "None" restrictions ['allow-stderr'] features [] depends ['python3-all', 'python3-hypothesis', 'python3-pytest', 'sqlfluff'] 145s autopkgtest [04:31:53]: build not needed 145s autopkgtest: DBG: sending command to testbed: copyup /tmp/autopkgtest.gvzmUI/build.Jwf/src/ /tmp/autopkgtest-work.07z5cnd3/out/tests-tree/ 146s autopkgtest: DBG: got reply from testbed: ok 146s autopkgtest: DBG: autodep8 generated control: ----- 146s Tests: upstream 146s Depends: 146s python3-all, 146s python3-hypothesis, 146s python3-pytest, 146s sqlfluff, 146s Restrictions: allow-stderr 146s 146s 146s 146s ------- 146s autopkgtest: DBG: processing dependency python3-all 146s autopkgtest: DBG: processing dependency python3-hypothesis 146s autopkgtest: DBG: processing dependency python3-pytest 146s autopkgtest: DBG: processing dependency sqlfluff 146s autopkgtest: DBG: marked alternatives ['sqlfluff'] as a synthesised dependency 146s autopkgtest: DBG: Test defined: name upstream path debian/tests/upstream command "None" restrictions ['allow-stderr'] features [] depends ['python3-all', 'python3-hypothesis', 'python3-pytest', 'sqlfluff'] 146s autopkgtest [04:31:54]: test upstream: preparing testbed 146s autopkgtest: DBG: testbed reset: modified=False, deps_installed=[], deps_new=['python3-all', 'python3-hypothesis', 'python3-pytest', 'sqlfluff'] 146s autopkgtest: DBG: Binaries: no registered binaries, not publishing anything 146s autopkgtest: DBG: install_deps: deps_new=['python3-all', 'python3-hypothesis', 'python3-pytest', 'sqlfluff'] 146s autopkgtest: DBG: install-deps: satisfying python3-all, python3-hypothesis, python3-pytest, sqlfluff 146s autopkgtest: DBG: can use apt-get on testbed: True 146s autopkgtest: DBG: testbed command ['/bin/sh', '-ec', '"$@" 3>&2 2>&1', 'run_apt_command', '/usr/bin/eatmydata', 'apt-get', '--quiet', '--assume-yes', '-o=APT::Status-Fd=3', '-o=APT::Install-Recommends=false', '-o=Dpkg::Options::=--force-confnew', '-o=Debug::pkgProblemResolver=true', 'satisfy', 'python3-all, python3-hypothesis, python3-pytest, sqlfluff'], kind install, sout raw, serr pipe, env ['DEBIAN_FRONTEND=noninteractive', 'APT_LISTBUGS_FRONTEND=none', 'APT_LISTCHANGES_FRONTEND=none'] 147s Reading package lists... 147s Building dependency tree... 147s Reading state information... 147s Starting pkgProblemResolver with broken count: 0 147s Starting 2 pkgProblemResolver with broken count: 0 147s Done 147s The following NEW packages will be installed: 147s diff-cover libnsl2 libpython3.12-minimal libpython3.12-stdlib python3-all 147s python3-click python3-colorama python3-dateutil python3-hypothesis 147s python3-iniconfig python3-packaging python3-pathspec python3-platformdirs 147s python3-pluggy python3-pytest python3-regex python3-sortedcontainers 147s python3-tblib python3-tqdm python3.12 python3.12-minimal sqlfluff 147s 0 upgraded, 22 newly installed, 0 to remove and 0 not upgraded. 147s Need to get 8084 kB of archives. 147s After this operation, 35.6 MB of additional disk space will be used. 147s Get:1 http://ftpmaster.internal/ubuntu plucky/main s390x libpython3.12-minimal s390x 3.12.9-1 [836 kB] 148s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x python3.12-minimal s390x 3.12.9-1 [2403 kB] 148s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x libnsl2 s390x 1.3.0-3build3 [44.1 kB] 148s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x libpython3.12-stdlib s390x 3.12.9-1 [2071 kB] 148s Get:5 http://ftpmaster.internal/ubuntu plucky/main s390x python3.12 s390x 3.12.9-1 [671 kB] 148s Get:6 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pluggy all 1.5.0-1 [21.0 kB] 148s Get:7 http://ftpmaster.internal/ubuntu plucky/universe s390x diff-cover all 9.2.2-1 [44.2 kB] 148s Get:8 http://ftpmaster.internal/ubuntu plucky/main s390x python3-all s390x 3.13.1-1~exp2 [898 B] 148s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x python3-click all 8.2.0-1 [81.9 kB] 148s Get:10 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-colorama all 0.4.6-4 [32.1 kB] 148s Get:11 http://ftpmaster.internal/ubuntu plucky/main s390x python3-dateutil all 2.9.0-3 [80.2 kB] 148s Get:12 http://ftpmaster.internal/ubuntu plucky/main s390x python3-sortedcontainers all 2.4.0-2 [27.6 kB] 148s Get:13 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-hypothesis all 6.125.2-1 [333 kB] 148s Get:14 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-iniconfig all 1.1.1-2 [6024 B] 148s Get:15 http://ftpmaster.internal/ubuntu plucky/main s390x python3-packaging all 24.2-1 [51.5 kB] 148s Get:16 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pathspec all 0.12.1-1 [24.5 kB] 148s Get:17 http://ftpmaster.internal/ubuntu plucky/main s390x python3-platformdirs all 4.3.6-1 [16.8 kB] 148s Get:18 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-pytest all 8.3.4-1 [252 kB] 148s Get:19 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-regex s390x 0.1.20241106-1 [317 kB] 148s Get:20 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-tblib all 3.0.0-6 [13.0 kB] 148s Get:21 http://ftpmaster.internal/ubuntu plucky/universe s390x python3-tqdm all 4.67.1-2 [92.5 kB] 148s Get:22 http://ftpmaster.internal/ubuntu plucky/universe s390x sqlfluff all 3.3.1-1 [665 kB] 148s Fetched 8084 kB in 1s (9281 kB/s) 148s Selecting previously unselected package libpython3.12-minimal:s390x. 148s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 55879 files and directories currently installed.) 148s Preparing to unpack .../00-libpython3.12-minimal_3.12.9-1_s390x.deb ... 148s Unpacking libpython3.12-minimal:s390x (3.12.9-1) ... 149s Selecting previously unselected package python3.12-minimal. 149s Preparing to unpack .../01-python3.12-minimal_3.12.9-1_s390x.deb ... 149s Unpacking python3.12-minimal (3.12.9-1) ... 149s Selecting previously unselected package libnsl2:s390x. 149s Preparing to unpack .../02-libnsl2_1.3.0-3build3_s390x.deb ... 149s Unpacking libnsl2:s390x (1.3.0-3build3) ... 149s Selecting previously unselected package libpython3.12-stdlib:s390x. 149s Preparing to unpack .../03-libpython3.12-stdlib_3.12.9-1_s390x.deb ... 149s Unpacking libpython3.12-stdlib:s390x (3.12.9-1) ... 149s Selecting previously unselected package python3.12. 149s Preparing to unpack .../04-python3.12_3.12.9-1_s390x.deb ... 149s Unpacking python3.12 (3.12.9-1) ... 149s Selecting previously unselected package python3-pluggy. 149s Preparing to unpack .../05-python3-pluggy_1.5.0-1_all.deb ... 149s Unpacking python3-pluggy (1.5.0-1) ... 149s Selecting previously unselected package diff-cover. 149s Preparing to unpack .../06-diff-cover_9.2.2-1_all.deb ... 149s Unpacking diff-cover (9.2.2-1) ... 149s Selecting previously unselected package python3-all. 149s Preparing to unpack .../07-python3-all_3.13.1-1~exp2_s390x.deb ... 149s Unpacking python3-all (3.13.1-1~exp2) ... 149s Selecting previously unselected package python3-click. 149s Preparing to unpack .../08-python3-click_8.2.0-1_all.deb ... 149s Unpacking python3-click (8.2.0-1) ... 149s Selecting previously unselected package python3-colorama. 149s Preparing to unpack .../09-python3-colorama_0.4.6-4_all.deb ... 149s Unpacking python3-colorama (0.4.6-4) ... 149s Selecting previously unselected package python3-dateutil. 149s Preparing to unpack .../10-python3-dateutil_2.9.0-3_all.deb ... 149s Unpacking python3-dateutil (2.9.0-3) ... 149s Selecting previously unselected package python3-sortedcontainers. 149s Preparing to unpack .../11-python3-sortedcontainers_2.4.0-2_all.deb ... 149s Unpacking python3-sortedcontainers (2.4.0-2) ... 149s Selecting previously unselected package python3-hypothesis. 149s Preparing to unpack .../12-python3-hypothesis_6.125.2-1_all.deb ... 149s Unpacking python3-hypothesis (6.125.2-1) ... 149s Selecting previously unselected package python3-iniconfig. 149s Preparing to unpack .../13-python3-iniconfig_1.1.1-2_all.deb ... 149s Unpacking python3-iniconfig (1.1.1-2) ... 149s Selecting previously unselected package python3-packaging. 149s Preparing to unpack .../14-python3-packaging_24.2-1_all.deb ... 149s Unpacking python3-packaging (24.2-1) ... 149s Selecting previously unselected package python3-pathspec. 149s Preparing to unpack .../15-python3-pathspec_0.12.1-1_all.deb ... 149s Unpacking python3-pathspec (0.12.1-1) ... 149s Selecting previously unselected package python3-platformdirs. 149s Preparing to unpack .../16-python3-platformdirs_4.3.6-1_all.deb ... 149s Unpacking python3-platformdirs (4.3.6-1) ... 149s Selecting previously unselected package python3-pytest. 149s Preparing to unpack .../17-python3-pytest_8.3.4-1_all.deb ... 149s Unpacking python3-pytest (8.3.4-1) ... 149s Selecting previously unselected package python3-regex. 149s Preparing to unpack .../18-python3-regex_0.1.20241106-1_s390x.deb ... 149s Unpacking python3-regex (0.1.20241106-1) ... 149s Selecting previously unselected package python3-tblib. 149s Preparing to unpack .../19-python3-tblib_3.0.0-6_all.deb ... 149s Unpacking python3-tblib (3.0.0-6) ... 149s Selecting previously unselected package python3-tqdm. 149s Preparing to unpack .../20-python3-tqdm_4.67.1-2_all.deb ... 149s Unpacking python3-tqdm (4.67.1-2) ... 149s Selecting previously unselected package sqlfluff. 149s Preparing to unpack .../21-sqlfluff_3.3.1-1_all.deb ... 149s Unpacking sqlfluff (3.3.1-1) ... 149s Setting up python3-iniconfig (1.1.1-2) ... 149s Setting up python3-tblib (3.0.0-6) ... 149s Setting up python3-colorama (0.4.6-4) ... 149s Setting up python3-tqdm (4.67.1-2) ... 150s Setting up libpython3.12-minimal:s390x (3.12.9-1) ... 150s Setting up python3-sortedcontainers (2.4.0-2) ... 150s Setting up python3-click (8.2.0-1) ... 150s Setting up python3-platformdirs (4.3.6-1) ... 150s Setting up python3-packaging (24.2-1) ... 150s Setting up python3-regex (0.1.20241106-1) ... 151s Setting up python3-pluggy (1.5.0-1) ... 151s Setting up libnsl2:s390x (1.3.0-3build3) ... 151s Setting up python3-dateutil (2.9.0-3) ... 151s Setting up diff-cover (9.2.2-1) ... 151s Setting up python3-pathspec (0.12.1-1) ... 151s Setting up python3.12-minimal (3.12.9-1) ... 152s Setting up libpython3.12-stdlib:s390x (3.12.9-1) ... 152s Setting up python3-pytest (8.3.4-1) ... 153s Setting up python3.12 (3.12.9-1) ... 154s Setting up python3-hypothesis (6.125.2-1) ... 155s Setting up python3-all (3.13.1-1~exp2) ... 155s Setting up sqlfluff (3.3.1-1) ... 156s Processing triggers for systemd (257.2-3ubuntu1) ... 156s Processing triggers for man-db (2.13.0-1) ... 156s Processing triggers for libc-bin (2.40-4ubuntu1) ... 156s autopkgtest: DBG: testbed command exited with code 0 156s autopkgtest: DBG: testbed command ['dpkg-query', '--show', '-f', '${Status}', 'sqlfluff'], kind short, sout pipe, serr pipe, env [] 156s autopkgtest: DBG: testbed command exited with code 0 156s autopkgtest: DBG: testbed command ['sh', '-ec', "dpkg-query --show -f '${Package}\\t${Version}\\n' > /tmp/autopkgtest.gvzmUI/upstream-packages.all"], kind short, sout raw, serr pipe, env [] 157s autopkgtest: DBG: testbed command exited with code 0 157s autopkgtest: DBG: sending command to testbed: copyup /tmp/autopkgtest.gvzmUI/upstream-packages.all /tmp/autopkgtest-work.07z5cnd3/out/upstream-packages.all 157s autopkgtest: DBG: got reply from testbed: ok 157s autopkgtest: DBG: testbed command ['test', '-e', '/tmp/autopkgtest.gvzmUI/build.Jwf/src'], kind short, sout raw, serr raw, env [] 157s autopkgtest: DBG: testbed command exited with code 0 157s autopkgtest: DBG: copydown: tb path /tmp/autopkgtest.gvzmUI/build.Jwf/src already exists 157s autopkgtest [04:32:05]: test upstream: [----------------------- 157s autopkgtest: DBG: testbed command ['su', '-s', '/bin/bash', 'ubuntu', '-c', 'set -e; exec /tmp/autopkgtest.gvzmUI/wrapper.sh --debug --artifacts=/tmp/autopkgtest.gvzmUI/upstream-artifacts --chdir=/tmp/autopkgtest.gvzmUI/build.Jwf/src --env=AUTOPKGTEST_TESTBED_ARCH=s390x --env=AUTOPKGTEST_TEST_ARCH=s390x --env=DEB_BUILD_OPTIONS=parallel=2 --env=DEBIAN_FRONTEND=noninteractive --env=LANG=C.UTF-8 --unset-env=LANGUAGE --unset-env=LC_ADDRESS --unset-env=LC_ALL --unset-env=LC_COLLATE --unset-env=LC_CTYPE --unset-env=LC_IDENTIFICATION --unset-env=LC_MEASUREMENT --unset-env=LC_MESSAGES --unset-env=LC_MONETARY --unset-env=LC_NAME --unset-env=LC_NUMERIC --unset-env=LC_PAPER --unset-env=LC_TELEPHONE --unset-env=LC_TIME --script-pid-file=/tmp/autopkgtest_script_pid --source-profile --stderr=/tmp/autopkgtest.gvzmUI/upstream-stderr --stdout=/tmp/autopkgtest.gvzmUI/upstream-stdout --tmp=/tmp/autopkgtest.gvzmUI/autopkgtest_tmp --env=ADT_TEST_TRIGGERS=python-click/8.2.0-1 --make-executable=/tmp/autopkgtest.gvzmUI/build.Jwf/src/debian/tests/upstream -- /tmp/autopkgtest.gvzmUI/build.Jwf/src/debian/tests/upstream'], kind test, sout raw, serr raw, env [] 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: creating AUTOPKGTEST_ARTIFACTS: /tmp/autopkgtest.gvzmUI/upstream-artifacts 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: changing to directory: /tmp/autopkgtest.gvzmUI/build.Jwf/src 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: setting environment: AUTOPKGTEST_TESTBED_ARCH=s390x 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: setting environment: AUTOPKGTEST_TEST_ARCH=s390x 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: setting environment: DEB_BUILD_OPTIONS=parallel=2 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: setting environment: DEBIAN_FRONTEND=noninteractive 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: setting environment: LANG=C.UTF-8 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LANGUAGE 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_ADDRESS 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_ALL 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_COLLATE 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_CTYPE 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_IDENTIFICATION 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_MEASUREMENT 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_MESSAGES 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_MONETARY 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_NAME 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_NUMERIC 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_PAPER 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_TELEPHONE 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: unsetting environment: LC_TIME 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: will create pid file: /tmp/autopkgtest_script_pid 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: pretending to be a login shell 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: will write standard error to /tmp/autopkgtest.gvzmUI/upstream-stderr 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: will write stdout to /tmp/autopkgtest.gvzmUI/upstream-stdout 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: creating AUTOPKGTEST_TMP: /tmp/autopkgtest.gvzmUI/autopkgtest_tmp 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: setting environment: ADT_TEST_TRIGGERS=python-click/8.2.0-1 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: marking as executable: /tmp/autopkgtest.gvzmUI/build.Jwf/src/debian/tests/upstream 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: command to run: /tmp/autopkgtest.gvzmUI/build.Jwf/src/debian/tests/upstream 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: copying /tmp/tmp.sjz14dU4Lv/out to stdout and file: /tmp/autopkgtest.gvzmUI/upstream-stdout 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: copying /tmp/tmp.sjz14dU4Lv/err to standard error and file: /tmp/autopkgtest.gvzmUI/upstream-stdout 157s /tmp/autopkgtest.gvzmUI/wrapper.sh: writing script pid 1686 to /tmp/autopkgtest_script_pid 157s + cp -a -t /tmp/autopkgtest.gvzmUI/autopkgtest_tmp test pyproject.toml README.md plugins 157s + cd /tmp/autopkgtest.gvzmUI/autopkgtest_tmp 157s + rm test/core/plugin_test.py 157s + py3versions -s 157s + printf =-=-=-=-=-= Running tests for %s =-=-=-=-=-=\n python3.12 157s + python3.12 -m pytest -k not appdir test 157s =-=-=-=-=-= Running tests for python3.12 =-=-=-=-=-= 163s ============================= test session starts ============================== 163s platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0 163s rootdir: /tmp/autopkgtest.gvzmUI/autopkgtest_tmp 163s configfile: pyproject.toml 163s plugins: hypothesis-6.125.2, typeguard-4.4.1 163s collected 8521 items / 1 deselected / 8520 selected 163s 163s test/api/classes_test.py .... [ 0%] 163s test/api/info_test.py .. [ 0%] 164s test/api/simple_test.py ................... [ 0%] 164s test/cli/autocomplete_test.py ..... [ 0%] 165s test/cli/commands_test.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 0%] 167s FFFFFFFFFFFFFFFFFFFFFFFFFF.......FFFFFF.......FFFFFFFFFFFFFFFFFFFFFFFFFF [ 1%] 168s FFFFFF.FFFFFFFFFFFFFFFFF.FFFFFFFFFFFF.FFFFFFFFFFFF [ 2%] 168s test/cli/formatters_test.py ..... [ 2%] 169s test/cli/helpers_test.py ......... [ 2%] 169s test/core/config/fluffconfig_test.py ........................... [ 2%] 169s test/core/config/loader_test.py ............. [ 2%] 169s test/core/config/validate_test.py ....... [ 3%] 169s test/core/errors_test.py ...... [ 3%] 169s test/core/helpers/dict_test.py ..... [ 3%] 169s test/core/helpers/file_test.py .........s. [ 3%] 169s test/core/helpers/slice_test.py ...................... [ 3%] 169s test/core/helpers/string_test.py ....... [ 3%] 169s test/core/linter/discovery_test.py ............... [ 3%] 169s test/core/linter/fix_test.py ...... [ 3%] 169s test/core/linter/linted_file_test.py ................. [ 4%] 171s test/core/linter/linter_test.py ........................................ [ 4%] 171s ... [ 4%] 171s test/core/parser/grammar/grammar_anyof_test.py ................ [ 4%] 171s test/core/parser/grammar/grammar_other_test.py ......................... [ 5%] 171s ... [ 5%] 171s test/core/parser/grammar/grammar_ref_test.py .... [ 5%] 172s test/core/parser/grammar/grammar_sequence_test.py ...................... [ 5%] 172s ..................... [ 5%] 172s test/core/parser/helpers_test.py .... [ 5%] 172s test/core/parser/lexer_test.py .............................. [ 6%] 172s test/core/parser/markers_test.py ......... [ 6%] 172s test/core/parser/match_algorithms_test.py ...................... [ 6%] 172s test/core/parser/match_result_test.py ... [ 6%] 172s test/core/parser/parse_test.py ... [ 6%] 172s test/core/parser/parser_test.py ........... [ 6%] 172s test/core/parser/segments/segments_base_test.py ........................ [ 6%] 172s ... [ 6%] 172s test/core/parser/segments/segments_common_test.py . [ 6%] 172s test/core/parser/segments/segments_file_test.py . [ 6%] 172s test/core/parser/segments/segments_raw_test.py .. [ 6%] 172s test/core/rules/crawlers_test.py ... [ 7%] 172s test/core/rules/docstring_test.py ..... [ 7%] 172s test/core/rules/functional/raw_file_slices_test.py ...... [ 7%] 172s test/core/rules/functional/segments_test.py .................... [ 7%] 173s test/core/rules/noqa_test.py ........................................... [ 7%] 173s .... [ 7%] 173s test/core/rules/reference_test.py .............. [ 8%] 174s test/core/rules/rules_test.py ............................. [ 8%] 174s test/core/templaters/base_test.py ............................ [ 8%] 174s test/core/templaters/builtins_test.py .. [ 8%] 175s test/core/templaters/jinja_test.py ..................................... [ 9%] 178s ........................................................................ [ 10%] 178s ..... [ 10%] 178s test/core/templaters/placeholder_test.py ....................... [ 10%] 178s test/core/templaters/python_test.py .................................... [ 10%] 178s [ 10%] 179s test/dialects/ansi_test.py ............................................. [ 11%] 179s ........ [ 11%] 183s test/dialects/bigquery_test.py ...... [ 11%] 188s test/dialects/dialects_test.py ......................................... [ 11%] 195s ........................................................................ [ 12%] 201s ........................................................................ [ 13%] 206s ........................................................................ [ 14%] 214s ........................................................................ [ 15%] 223s ........................................................................ [ 16%] 229s ........................................................................ [ 17%] 231s ........................................................................ [ 17%] 234s ........................................................................ [ 18%] 239s ........................................................................ [ 19%] 248s ........................................................................ [ 20%] 254s ........................................................................ [ 21%] 264s ........................................................................ [ 22%] 270s ........................................................................ [ 22%] 280s ........................................................................ [ 23%] 291s ........................................................................ [ 24%] 305s ........................................................................ [ 25%] 310s ........................................................................ [ 26%] 314s ........................................................................ [ 27%] 318s ........................................................................ [ 28%] 324s ........................................................................ [ 28%] 326s ........................................................................ [ 29%] 329s ........................................................................ [ 30%] 337s ........................................................................ [ 31%] 342s ........................................................................ [ 32%] 359s ........................................................................ [ 33%] 386s ........................................................................ [ 33%] 403s ........................................................................ [ 34%] 418s ........................................................................ [ 35%] 436s ........................................................................ [ 36%] 461s ........................................................................ [ 37%] 485s ........................................................................ [ 38%] 494s ........................................................................ [ 39%] 506s ........................................................................ [ 39%] 519s ........................................................................ [ 40%] 541s ........................................................................ [ 41%] 558s ........................................................................ [ 42%] 590s ........................................................................ [ 43%] 619s ........................................................................ [ 44%] 647s ........................................................................ [ 44%] 695s ........................................................................ [ 45%] 737s ........................................................................ [ 46%] 767s ........................................................................ [ 47%] 775s ........................................................................ [ 48%] 782s ........................................................................ [ 49%] 796s ........................................................................ [ 50%] 801s ........................................................................ [ 50%] 810s ........................................................................ [ 51%] 847s ........................................................................ [ 52%] 866s ........................................................................ [ 53%] 882s ........................................................................ [ 54%] 888s ........................................................................ [ 55%] 895s ........................................................................ [ 55%] 899s ........................................................................ [ 56%] 905s ........................................................................ [ 57%] 913s ........................................................................ [ 58%] 919s ........................................................................ [ 59%] 921s ........................................................................ [ 60%] 924s ........................................................................ [ 61%] 926s ........................................................................ [ 61%] 933s ........................................................................ [ 62%] 937s ........................................................................ [ 63%] 944s ........................................................................ [ 64%] 951s ........................................................................ [ 65%] 956s ........................................................................ [ 66%] 966s ........................................................................ [ 66%] 976s ........................................................................ [ 67%] 981s ........................................................................ [ 68%] 984s ........................................................................ [ 69%] 987s ........................................................................ [ 70%] 992s ........................................................................ [ 71%] 993s ........................................................................ [ 71%] 996s ........................................................................ [ 72%] 1004s ........................................................................ [ 73%] 1010s ........................................................................ [ 74%] 1014s .................................................... [ 75%] 1014s test/dialects/exasol_test.py ... [ 75%] 1015s test/dialects/postgres_test.py ..................... [ 75%] 1016s test/dialects/snowflake_test.py ............... [ 75%] 1017s test/dialects/soql_test.py ...... [ 75%] 1017s test/dialects/unparsable_test.py ... [ 75%] 1018s test/diff_quality_plugin_test.py FFFF [ 75%] 1018s test/rules/std_AL04_test.py ... [ 75%] 1020s test/rules/std_AL09_CP02_RF06_combo_test.py .......... [ 75%] 1021s test/rules/std_AM06_test.py ... [ 75%] 1021s test/rules/std_CV02_test.py . [ 75%] 1021s test/rules/std_CV09_test.py . [ 75%] 1021s test/rules/std_JJ01_test.py . [ 75%] 1021s test/rules/std_LT01_LT02_LT09_combo_test.py . [ 75%] 1021s test/rules/std_LT01_LT04_test.py . [ 75%] 1021s test/rules/std_LT01_ST02_test.py . [ 76%] 1022s test/rules/std_LT02_LT04_test.py . [ 76%] 1022s test/rules/std_LT02_LT11_combo_test.py .. [ 76%] 1022s test/rules/std_LT03_test.py ... [ 76%] 1023s test/rules/std_LT04_ST06_test.py ... [ 76%] 1023s test/rules/std_LT04_test.py . [ 76%] 1023s test/rules/std_LT05_LT09_combo_test.py ... [ 76%] 1023s test/rules/std_LT12_CV06_test.py . [ 76%] 1024s test/rules/std_RF01_LT09_test.py . [ 76%] 1024s test/rules/std_RF02_test.py . [ 76%] 1024s test/rules/std_ST03_test.py . [ 76%] 1024s test/rules/std_ST05_LT08_test.py . [ 76%] 1025s test/rules/std_ST05_LT09_test.py .. [ 76%] 1030s test/rules/std_fix_auto_test.py ........................................ [ 76%] 1035s .... [ 76%] 1036s test/rules/std_roundtrip_test.py ........ [ 76%] 1037s test/rules/std_test.py ......................... [ 77%] 1043s test/rules/yaml_test_cases_test.py ..................................... [ 77%] 1058s ........................................................................ [ 78%] 1070s ........................................................................ [ 79%] 1083s ........................................................................ [ 80%] 1096s ........................................................................ [ 80%] 1106s ........................................................................ [ 81%] 1117s ........................................................................ [ 82%] 1131s ........................................................................ [ 83%] 1142s ........................................................................ [ 84%] 1154s ........................................................................ [ 85%] 1162s ........................................................................ [ 86%] 1182s ........................................................................ [ 86%] 1198s ........................................................................ [ 87%] 1218s ........................................................................ [ 88%] 1243s ........................................................................ [ 89%] 1262s ........................................................................ [ 90%] 1277s ........................................................................ [ 91%] 1292s ........................................................................ [ 91%] 1305s ........................................................................ [ 92%] 1318s ........................................................................ [ 93%] 1328s ........................................................................ [ 94%] 1337s ........................................................................ [ 95%] 1348s ........................................................................ [ 96%] 1367s ........................................................................ [ 97%] 1386s ........................................................................ [ 97%] 1393s ............................................... [ 98%] 1393s test/testing_test.py ...... [ 98%] 1395s test/utils/analysis/query_test.py ................. [ 98%] 1395s test/utils/reflow/depthmap_test.py ... [ 98%] 1396s test/utils/reflow/rebreak_test.py ................ [ 98%] 1401s test/utils/reflow/reindent_test.py ..................................... [ 99%] 1403s ....................... [ 99%] 1404s test/utils/reflow/respace_test.py .................. [ 99%] 1406s test/utils/reflow/sequence_test.py ............... [100%] 1406s 1406s =================================== FAILURES =================================== 1406s _________________________ test__cli__command_directed __________________________ 1406s 1406s def test__cli__command_directed(): 1406s """Basic checking of lint functionality.""" 1406s > result = invoke_assert_code( 1406s ret_code=1, 1406s args=[ 1406s lint, 1406s [ 1406s "--disable-progress-bar", 1406s "test/fixtures/linter/indentation_error_simple.sql", 1406s ], 1406s ], 1406s ) 1406s 1406s test/cli/commands_test.py:89: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--disable-progress-bar', 'test/fixtures/linter/indentation_error_simple.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s __________________________ test__cli__command_dialect __________________________ 1406s 1406s def test__cli__command_dialect(): 1406s """Check the script raises the right exception on an unknown dialect.""" 1406s # The dialect is unknown should be a non-zero exit code 1406s > invoke_assert_code( 1406s ret_code=2, 1406s args=[ 1406s lint, 1406s [ 1406s "-n", 1406s "--dialect", 1406s "faslkjh", 1406s "test/fixtures/linter/indentation_error_simple.sql", 1406s ], 1406s ], 1406s ) 1406s 1406s test/cli/commands_test.py:113: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2 1406s args = [, ['-n', '--dialect', 'faslkjh', 'test/fixtures/linter/indentation_error_simple.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_no_dialect[command0] ____________________ 1406s 1406s command = 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s render, 1406s parse, 1406s lint, 1406s cli_format, 1406s fix, 1406s ], 1406s ) 1406s def test__cli__command_no_dialect(command): 1406s """Check the script raises the right exception no dialect.""" 1406s # The dialect is unknown should be a non-zero exit code 1406s > result = invoke_assert_code( 1406s ret_code=2, 1406s args=[ 1406s command, 1406s ["-"], 1406s ], 1406s cli_input="SELECT 1", 1406s ) 1406s 1406s test/cli/commands_test.py:140: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2, args = [, ['-']], kwargs = {'input': 'SELECT 1'} 1406s cli_input = 'SELECT 1', mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_no_dialect[command1] ____________________ 1406s 1406s command = 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s render, 1406s parse, 1406s lint, 1406s cli_format, 1406s fix, 1406s ], 1406s ) 1406s def test__cli__command_no_dialect(command): 1406s """Check the script raises the right exception no dialect.""" 1406s # The dialect is unknown should be a non-zero exit code 1406s > result = invoke_assert_code( 1406s ret_code=2, 1406s args=[ 1406s command, 1406s ["-"], 1406s ], 1406s cli_input="SELECT 1", 1406s ) 1406s 1406s test/cli/commands_test.py:140: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2, args = [, ['-']], kwargs = {'input': 'SELECT 1'} 1406s cli_input = 'SELECT 1', mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_no_dialect[command2] ____________________ 1406s 1406s command = 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s render, 1406s parse, 1406s lint, 1406s cli_format, 1406s fix, 1406s ], 1406s ) 1406s def test__cli__command_no_dialect(command): 1406s """Check the script raises the right exception no dialect.""" 1406s # The dialect is unknown should be a non-zero exit code 1406s > result = invoke_assert_code( 1406s ret_code=2, 1406s args=[ 1406s command, 1406s ["-"], 1406s ], 1406s cli_input="SELECT 1", 1406s ) 1406s 1406s test/cli/commands_test.py:140: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2, args = [, ['-']], kwargs = {'input': 'SELECT 1'} 1406s cli_input = 'SELECT 1', mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_no_dialect[command3] ____________________ 1406s 1406s command = 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s render, 1406s parse, 1406s lint, 1406s cli_format, 1406s fix, 1406s ], 1406s ) 1406s def test__cli__command_no_dialect(command): 1406s """Check the script raises the right exception no dialect.""" 1406s # The dialect is unknown should be a non-zero exit code 1406s > result = invoke_assert_code( 1406s ret_code=2, 1406s args=[ 1406s command, 1406s ["-"], 1406s ], 1406s cli_input="SELECT 1", 1406s ) 1406s 1406s test/cli/commands_test.py:140: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2, args = [, ['-']], kwargs = {'input': 'SELECT 1'} 1406s cli_input = 'SELECT 1', mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_no_dialect[command4] ____________________ 1406s 1406s command = 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s render, 1406s parse, 1406s lint, 1406s cli_format, 1406s fix, 1406s ], 1406s ) 1406s def test__cli__command_no_dialect(command): 1406s """Check the script raises the right exception no dialect.""" 1406s # The dialect is unknown should be a non-zero exit code 1406s > result = invoke_assert_code( 1406s ret_code=2, 1406s args=[ 1406s command, 1406s ["-"], 1406s ], 1406s cli_input="SELECT 1", 1406s ) 1406s 1406s test/cli/commands_test.py:140: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2, args = [, ['-']], kwargs = {'input': 'SELECT 1'} 1406s cli_input = 'SELECT 1', mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________ test__cli__command_parse_error_dialect_explicit_warning ____________ 1406s 1406s def test__cli__command_parse_error_dialect_explicit_warning(): 1406s """Check parsing error raises the right warning.""" 1406s # For any parsing error there should be a non-zero exit code 1406s # and a human-readable warning should be displayed. 1406s # Dialect specified as commandline option. 1406s > invoke_assert_code( 1406s ret_code=1, 1406s args=[ 1406s parse, 1406s [ 1406s "-n", 1406s "--dialect", 1406s "postgres", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ], 1406s assert_output_contains=( 1406s "WARNING: Parsing errors found and dialect is set to 'postgres'. " 1406s "Have you configured your dialect correctly?" 1406s ), 1406s ) 1406s 1406s test/cli/commands_test.py:159: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['-n', '--dialect', 'postgres', 'test/fixtures/cli/fail_many.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True 1406s assert_output_contains = "WARNING: Parsing errors found and dialect is set to 'postgres'. Have you configured your dialect correctly?" 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________ test__cli__command_parse_error_dialect_implicit_warning ____________ 1406s 1406s def test__cli__command_parse_error_dialect_implicit_warning(): 1406s """Check parsing error raises the right warning.""" 1406s # For any parsing error there should be a non-zero exit code 1406s # and a human-readable warning should be displayed. 1406s # Dialect specified in .sqlfluff config. 1406s > invoke_assert_code( 1406s ret_code=1, 1406s args=[ 1406s # Config sets dialect to tsql 1406s parse, 1406s [ 1406s "-n", 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ], 1406s assert_output_contains=( 1406s "WARNING: Parsing errors found and dialect is set to 'tsql'. " 1406s "Have you configured your dialect correctly?" 1406s ), 1406s ) 1406s 1406s test/cli/commands_test.py:182: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['-n', '--config', 'test/fixtures/cli/extra_configs/.sqlfluff', 'test/fixtures/cli/fail_many.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True 1406s assert_output_contains = "WARNING: Parsing errors found and dialect is set to 'tsql'. Have you configured your dialect correctly?" 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ______________________ test__cli__command_dialect_legacy _______________________ 1406s 1406s def test__cli__command_dialect_legacy(): 1406s """Check the script raises the right exception on a legacy dialect.""" 1406s > invoke_assert_code( 1406s ret_code=2, 1406s args=[ 1406s lint, 1406s [ 1406s "-n", 1406s "--dialect", 1406s "exasol_fs", 1406s "test/fixtures/linter/indentation_error_simple.sql", 1406s ], 1406s ], 1406s assert_output_contains="Please use the 'exasol' dialect instead.", 1406s ) 1406s 1406s test/cli/commands_test.py:203: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2 1406s args = [, ['-n', '--dialect', 'exasol_fs', 'test/fixtures/linter/indentation_error_simple.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True 1406s assert_output_contains = "Please use the 'exasol' dialect instead." 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _____________________ test__cli__command_extra_config_fail _____________________ 1406s 1406s def test__cli__command_extra_config_fail(): 1406s """Check the script raises the right exception non-existent extra config path.""" 1406s > invoke_assert_code( 1406s ret_code=2, 1406s args=[ 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluffsdfdfdfsfd", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ], 1406s assert_output_contains=( 1406s "Extra config path 'test/fixtures/cli/extra_configs/.sqlfluffsdfdfdfsfd' " 1406s "does not exist." 1406s ), 1406s ) 1406s 1406s test/cli/commands_test.py:220: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2 1406s args = [, ['--config', 'test/fixtures/cli/extra_configs/.sqlfluffsdfdfdfsfd', 'test/fixtures/cli/extra_config_tsql.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True 1406s assert_output_contains = "Extra config path 'test/fixtures/cli/extra_configs/.sqlfluffsdfdfdfsfd' does not exist." 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command0-test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql-0-[L: 5, P: 1] | join_clause:\n[L: 5, P: 1] | keyword: 'POSITIONAL'] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql' 1406s ret_code = 0 1406s output = "[L: 5, P: 1] | join_clause:\n[L: 5, P: 1] | keyword: 'POSITIONAL'" 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = [, ['--stdin-filename', 'test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True 1406s assert_output_contains = "[L: 5, P: 1] | join_clause:\n[L: 5, P: 1] | keyword: 'POSITIONAL'" 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command1-test/fixtures/an_ansi_config_here.sql-1-Parsing errors found and dialect is set to 'ansi'.] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/an_ansi_config_here.sql', ret_code = 1 1406s output = "Parsing errors found and dialect is set to 'ansi'." 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--stdin-filename', 'test/fixtures/an_ansi_config_here.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True 1406s assert_output_contains = "Parsing errors found and dialect is set to 'ansi'." 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command2-test/fixtures/cli/stdin_filename/stdin_filename.sql-0-All Finished!] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/cli/stdin_filename/stdin_filename.sql' 1406s ret_code = 0, output = 'All Finished!' 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = [, ['--stdin-filename', 'test/fixtures/cli/stdin_filename/stdin_filename.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True, assert_output_contains = 'All Finished!' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command3-test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql-0-All Finished!] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql' 1406s ret_code = 0, output = 'All Finished!' 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = [, ['--stdin-filename', 'test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True, assert_output_contains = 'All Finished!' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command4-test/fixtures/an_ansi_config_here.sql-1-Parsing errors found and dialect is set to 'ansi'.] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/an_ansi_config_here.sql', ret_code = 1 1406s output = "Parsing errors found and dialect is set to 'ansi'." 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--stdin-filename', 'test/fixtures/an_ansi_config_here.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True 1406s assert_output_contains = "Parsing errors found and dialect is set to 'ansi'." 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command5-test/fixtures/cli/stdin_filename/stdin_filename.sql-0-SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/cli/stdin_filename/stdin_filename.sql' 1406s ret_code = 0 1406s output = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = [, ['--stdin-filename', 'test/fixtures/cli/stdin_filename/stdin_filename.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True 1406s assert_output_contains = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command6-test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql-0-SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql' 1406s ret_code = 0 1406s output = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = [, ['--stdin-filename', 'test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True 1406s assert_output_contains = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command7-test/fixtures/an_ansi_config_here.sql-1-[1 templating/parsing errors found]] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/an_ansi_config_here.sql', ret_code = 1 1406s output = '[1 templating/parsing errors found]' 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--stdin-filename', 'test/fixtures/an_ansi_config_here.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True 1406s assert_output_contains = '[1 templating/parsing errors found]' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command8-test/fixtures/cli/stdin_filename/stdin_filename.sql-0-SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/cli/stdin_filename/stdin_filename.sql' 1406s ret_code = 0 1406s output = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = [, ['--stdin-filename', 'test/fixtures/cli/stdin_filename/stdin_filename.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True 1406s assert_output_contains = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command9-test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql-0-SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql' 1406s ret_code = 0 1406s output = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = [, ['--stdin-filename', 'test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True 1406s assert_output_contains = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command_stdin_filename_config[command10-test/fixtures/an_ansi_config_here.sql-1-Unfixable violations detected.] _ 1406s 1406s command = 1406s stdin_filepath = 'test/fixtures/an_ansi_config_here.sql', ret_code = 1 1406s output = 'Unfixable violations detected.' 1406s 1406s @pytest.mark.parametrize( 1406s ("command", "stdin_filepath", "ret_code", "output"), 1406s [ 1406s ( 1406s parse, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s ( 1406s "[L: 5, P: 1] | join_clause:\n" 1406s "[L: 5, P: 1] | keyword:" 1406s " 'POSITIONAL'" 1406s ), 1406s ), 1406s ( 1406s parse, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s "All Finished!", 1406s ), 1406s ( 1406s lint, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Parsing errors found and dialect is set to 'ansi'.", 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s cli_format, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "[1 templating/parsing errors found]", 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql", 1406s 0, 1406s stdin_cli_input, 1406s ), 1406s ( 1406s fix, 1406s "test/fixtures/an_ansi_config_here.sql", 1406s 1, 1406s "Unfixable violations detected.", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_stdin_filename_config(command, stdin_filepath, ret_code, output): 1406s """Check the script picks up the config from the indicated path.""" 1406s > invoke_assert_code( 1406s ret_code=ret_code, 1406s args=[ 1406s command, 1406s [ 1406s "--stdin-filename", 1406s stdin_filepath, 1406s "-", 1406s ], 1406s ], 1406s cli_input=stdin_cli_input, 1406s assert_output_contains=output, 1406s ) 1406s 1406s test/cli/commands_test.py:319: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--stdin-filename', 'test/fixtures/an_ansi_config_here.sql', '-']] 1406s kwargs = {'input': 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n'} 1406s cli_input = 'SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n' 1406s mix_stderr = True, assert_output_contains = 'Unfixable violations detected.' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_stdin[command0] ____________________ 1406s 1406s command = ('-', '-n') 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s ( 1406s "-", 1406s "-n", 1406s ), 1406s ( 1406s "-", 1406s "-n", 1406s "-v", 1406s ), 1406s ( 1406s "-", 1406s "-n", 1406s "-vv", 1406s ), 1406s ( 1406s "-", 1406s "-vv", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_stdin(command): 1406s """Check basic commands on a simple script using stdin. 1406s 1406s The subprocess command should exit without errors, as no issues should be found. 1406s """ 1406s with open("test/fixtures/cli/passing_a.sql") as test_file: 1406s sql = test_file.read() 1406s > invoke_assert_code(args=[lint, ("--dialect=ansi",) + command], cli_input=sql) 1406s 1406s test/cli/commands_test.py:364: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = [, ('--dialect=ansi', '-', '-n')] 1406s kwargs = {'input': 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n'} 1406s cli_input = 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n' 1406s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_stdin[command1] ____________________ 1406s 1406s command = ('-', '-n', '-v') 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s ( 1406s "-", 1406s "-n", 1406s ), 1406s ( 1406s "-", 1406s "-n", 1406s "-v", 1406s ), 1406s ( 1406s "-", 1406s "-n", 1406s "-vv", 1406s ), 1406s ( 1406s "-", 1406s "-vv", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_stdin(command): 1406s """Check basic commands on a simple script using stdin. 1406s 1406s The subprocess command should exit without errors, as no issues should be found. 1406s """ 1406s with open("test/fixtures/cli/passing_a.sql") as test_file: 1406s sql = test_file.read() 1406s > invoke_assert_code(args=[lint, ("--dialect=ansi",) + command], cli_input=sql) 1406s 1406s test/cli/commands_test.py:364: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = [, ('--dialect=ansi', '-', '-n', '-v')] 1406s kwargs = {'input': 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n'} 1406s cli_input = 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n' 1406s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_stdin[command2] ____________________ 1406s 1406s command = ('-', '-n', '-vv') 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s ( 1406s "-", 1406s "-n", 1406s ), 1406s ( 1406s "-", 1406s "-n", 1406s "-v", 1406s ), 1406s ( 1406s "-", 1406s "-n", 1406s "-vv", 1406s ), 1406s ( 1406s "-", 1406s "-vv", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_stdin(command): 1406s """Check basic commands on a simple script using stdin. 1406s 1406s The subprocess command should exit without errors, as no issues should be found. 1406s """ 1406s with open("test/fixtures/cli/passing_a.sql") as test_file: 1406s sql = test_file.read() 1406s > invoke_assert_code(args=[lint, ("--dialect=ansi",) + command], cli_input=sql) 1406s 1406s test/cli/commands_test.py:364: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = [, ('--dialect=ansi', '-', '-n', '-vv')] 1406s kwargs = {'input': 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n'} 1406s cli_input = 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n' 1406s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_stdin[command3] ____________________ 1406s 1406s command = ('-', '-vv') 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s ( 1406s "-", 1406s "-n", 1406s ), 1406s ( 1406s "-", 1406s "-n", 1406s "-v", 1406s ), 1406s ( 1406s "-", 1406s "-n", 1406s "-vv", 1406s ), 1406s ( 1406s "-", 1406s "-vv", 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_stdin(command): 1406s """Check basic commands on a simple script using stdin. 1406s 1406s The subprocess command should exit without errors, as no issues should be found. 1406s """ 1406s with open("test/fixtures/cli/passing_a.sql") as test_file: 1406s sql = test_file.read() 1406s > invoke_assert_code(args=[lint, ("--dialect=ansi",) + command], cli_input=sql) 1406s 1406s test/cli/commands_test.py:364: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = [, ('--dialect=ansi', '-', '-vv')] 1406s kwargs = {'input': 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n'} 1406s cli_input = 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n' 1406s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _____________________ test__cli__command_lint_empty_stdin ______________________ 1406s 1406s def test__cli__command_lint_empty_stdin(): 1406s """Check linting an empty file raises no exceptions. 1406s 1406s https://github.com/sqlfluff/sqlfluff/issues/4807 1406s """ 1406s > invoke_assert_code(args=[lint, ("-d", "ansi", "-")], cli_input="") 1406s 1406s test/cli/commands_test.py:372: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = [, ('-d', 'ansi', '-')], kwargs = {} 1406s cli_input = '', mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _______________________ test__cli__command_render_stdin ________________________ 1406s 1406s def test__cli__command_render_stdin(): 1406s """Check render on a simple script using stdin.""" 1406s with open("test/fixtures/cli/passing_a.sql") as test_file: 1406s sql = test_file.read() 1406s 1406s > invoke_assert_code( 1406s args=[render, ("--dialect=ansi", "-")], 1406s cli_input=sql, 1406s # Check we get back out the same file we input. 1406s assert_output_contains=sql, 1406s ) 1406s 1406s test/cli/commands_test.py:380: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = [, ('--dialect=ansi', '-')] 1406s kwargs = {'input': 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n'} 1406s cli_input = 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n' 1406s mix_stderr = True 1406s assert_output_contains = 'SELECT\n tbl.name,\n tbl.value\nFROM tbl\n' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command0] ____________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '--exclude-rules', 'AM05']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '--exclude-rules', 'AM05']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command1] ____________________ 1406s 1406s command = (, ['test/fixtures/cli/passing_b.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = (, ['test/fixtures/cli/passing_b.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command2] ____________________ 1406s 1406s command = (, ['test/fixtures/cli/jinja_variants.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['test/fixtures/cli/jinja_variants.sql']), kwargs = {} 1406s cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command3] ____________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_a.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = (, ['-n', 'test/fixtures/cli/passing_a.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command4] ____________________ 1406s 1406s command = (, ['-n', '-v', 'test/fixtures/cli/passing_a.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', '-v', 'test/fixtures/cli/passing_a.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command5] ____________________ 1406s 1406s command = (, ['-n', '-vvvv', 'test/fixtures/cli/passing_a.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', '-vvvv', 'test/fixtures/cli/passing_a.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command6] ____________________ 1406s 1406s command = (, ['-vvvv', 'test/fixtures/cli/passing_a.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-vvvv', 'test/fixtures/cli/passing_a.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command7] ____________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-vvvvvvvvvvv', '--exclude-rules', 'AM05']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-vvvvvvvvvvv', '--exclude-rules', 'AM05']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command8] ____________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-vvv', '--logger', 'parser', '-e', ...]) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-vvv', '--logger', 'parser', '-e', ...]) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command9] ____________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '--exclude-rules', 'AM05']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '--exclude-rules', 'AM05']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command10] ___________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-vvvvvvvvvvv', '-e', 'AM05']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-vvvvvvvvvvv', '-e', 'AM05']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command11] ___________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-c']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-c']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command12] ___________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-c', '--format', 'yaml']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '-c', '--format', 'yaml']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command13] ___________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '--format', 'yaml']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '--format', 'yaml']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command14] ___________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_b.sql', '--format', 'none']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_b.sql', '--format', 'none']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command15] ___________________ 1406s 1406s command = (, ['test/fixtures/cli/jinja_variants.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = (, ['test/fixtures/cli/jinja_variants.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command16] ___________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_timing.sql', '--bench']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_timing.sql', '--bench']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command17] ___________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_timing.sql', '--bench']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_timing.sql', '--bench']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command18] ___________________ 1406s 1406s command = (, ['-n', 'test/fixtures/cli/passing_timing.sql', '--bench']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', 'test/fixtures/cli/passing_timing.sql', '--bench']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command19] ___________________ 1406s 1406s command = (, ['-n', '--rules', 'CP01', 'test/fixtures/linter/operator_errors.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', '--rules', 'CP01', 'test/fixtures/linter/operator_errors.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command20] ___________________ 1406s 1406s command = (, ['-n', '--ignore', 'linting', '-p', '2', 'test/fixtures/linter/operator_errors.sql', ...]) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', '--ignore', 'linting', '-p', '2', 'test/fixtures/linter/operator_errors.sql', ...]) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command21] ___________________ 1406s 1406s command = (, ['-n', '--rules', 'CP01,LT02', 'test/fixtures/linter/operator_errors.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', '--rules', 'CP01,LT02', 'test/fixtures/linter/operator_errors.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command22] ___________________ 1406s 1406s command = (, ['-n', '--rules', 'CP01,LT01', '--exclude-rules', 'LT01,AL07', 'test/fixtures/linter/operator_errors.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', '--rules', 'CP01,LT01', '--exclude-rules', 'LT01,AL07', 'test/fixtures/linter/operator_errors.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command23] ___________________ 1406s 1406s command = (, ['-n', '--exclude-rules', 'LT01,LT03,AL07', 'test/fixtures/linter/operator_errors.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', '--exclude-rules', 'LT01,LT03,AL07', 'test/fixtures/linter/operator_errors.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command24] ___________________ 1406s 1406s command = (, ['-n', '--exclude-rules', 'LT02,LT12,AL07', '--ignore', 'parsing,lexing', 'test/fixtures/linter/parse_lex_error.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['-n', '--exclude-rules', 'LT02,LT12,AL07', '--ignore', 'parsing,lexing', 'test/fixtures/linter/parse_lex_error.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command25] ___________________ 1406s 1406s command = (, ['--nofail', 'test/fixtures/linter/parse_lex_error.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['--nofail', 'test/fixtures/linter/parse_lex_error.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command26] ___________________ 1406s 1406s command = (, ['--config', 'test/fixtures/cli/extra_configs/.sqlfluff', 'test/fixtures/cli/extra_config_tsql.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['--config', 'test/fixtures/cli/extra_configs/.sqlfluff', 'test/fixtures/cli/extra_config_tsql.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command27] ___________________ 1406s 1406s command = (, ['--config', 'test/fixtures/cli/extra_configs/pyproject.toml', 'test/fixtures/cli/extra_config_tsql.sql']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['--config', 'test/fixtures/cli/extra_configs/pyproject.toml', 'test/fixtures/cli/extra_config_tsql.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command28] ___________________ 1406s 1406s command = (, ['test/fixtures/cli/passing_a.sql', '--persist-timing', 'test.csv']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['test/fixtures/cli/passing_a.sql', '--persist-timing', 'test.csv']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________ test__cli__command_lint_parse[command29] ___________________ 1406s 1406s command = (, ['--help']) 1406s 1406s @pytest.mark.parametrize( 1406s "command", 1406s [ 1406s # Test basic linting 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Basic render 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/passing_b.sql", 1406s ], 1406s ), 1406s # Render with variants 1406s ( 1406s render, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Original tests from test__cli__command_lint 1406s (lint, ["-n", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-v", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-n", "-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s (lint, ["-vvvv", "test/fixtures/cli/passing_a.sql"]), 1406s # Test basic linting with very high verbosity 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic linting with specific logger. 1406s # Also test short rule exclusion. 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvv", 1406s "--logger", 1406s "parser", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "--exclude-rules", 1406s "AM05", 1406s ], 1406s ), 1406s # Test basic parsing with very high verbosity 1406s ( 1406s parse, 1406s [ 1406s "-n", 1406s "test/fixtures/cli/passing_b.sql", 1406s "-vvvvvvvvvvv", 1406s "-e", 1406s "AM05", 1406s ], 1406s ), 1406s # Check basic parsing, with the code only option 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c"]), 1406s # Check basic parsing, with the yaml output 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "-c", "--format", "yaml"]), 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "yaml"]), 1406s # Check parsing with no output (used mostly for testing) 1406s (parse, ["-n", "test/fixtures/cli/passing_b.sql", "--format", "none"]), 1406s # Parsing with variants 1406s ( 1406s parse, 1406s [ 1406s "test/fixtures/cli/jinja_variants.sql", 1406s ], 1406s ), 1406s # Check the benching commands 1406s (parse, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (lint, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s (fix, ["-n", "test/fixtures/cli/passing_timing.sql", "--bench"]), 1406s # Check linting works in specifying rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check ignoring linting (multiprocess) 1406s # https://github.com/sqlfluff/sqlfluff/issues/5066 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--ignore", 1406s "linting", 1406s "-p", 1406s "2", 1406s "test/fixtures/linter/operator_errors.sql", 1406s "test/fixtures/linter/comma_errors.sql", 1406s ], 1406s ), 1406s # Check linting works in specifying multiple rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT02", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with both included and excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--rules", 1406s "CP01,LT01", 1406s "--exclude-rules", 1406s "LT01,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check linting works with just excluded rules 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT01,LT03,AL07", 1406s "test/fixtures/linter/operator_errors.sql", 1406s ], 1406s ), 1406s # Check that ignoring works (also checks that unicode files parse). 1406s ( 1406s lint, 1406s [ 1406s "-n", 1406s "--exclude-rules", 1406s "LT02,LT12,AL07", 1406s "--ignore", 1406s "parsing,lexing", 1406s "test/fixtures/linter/parse_lex_error.sql", 1406s ], 1406s ), 1406s # Check nofail works 1406s (lint, ["--nofail", "test/fixtures/linter/parse_lex_error.sql"]), 1406s # Check config works (sets dialect to tsql) 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/.sqlfluff", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s ( 1406s lint, 1406s [ 1406s "--config", 1406s "test/fixtures/cli/extra_configs/pyproject.toml", 1406s "test/fixtures/cli/extra_config_tsql.sql", 1406s ], 1406s ), 1406s # Check timing outputs doesn't raise exceptions 1406s (lint, ["test/fixtures/cli/passing_a.sql", "--persist-timing", "test.csv"]), 1406s # Check lint --help command doesn't raise exception. 1406s # NOTE: This tests the LazySequence in action. 1406s (lint, ["--help"]), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse(command): 1406s """Check basic commands on a more complicated script.""" 1406s > invoke_assert_code(args=command) 1406s 1406s test/cli/commands_test.py:580: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = (, ['--help']), kwargs = {}, cli_input = None 1406s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command0-1] ____________ 1406s 1406s command = (, ['--rules', 'LT01', 'test/fixtures/cli/fail_many.sql', '-vvvvvvv']) 1406s ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = (, ['--rules', 'LT01', 'test/fixtures/cli/fail_many.sql', '-vvvvvvv']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command1-1] ____________ 1406s 1406s command = (, ['--rules', 'LT01', '--fixed-suffix', '_fix', 'test/fixtures/cli/fail_many.sql']) 1406s ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = (, ['--rules', 'LT01', '--fixed-suffix', '_fix', 'test/fixtures/cli/fail_many.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command2-1] ____________ 1406s 1406s command = (, ['--fixed-suffix', '_fix', 'test/fixtures/cli/fail_many.sql']) 1406s ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = (, ['--fixed-suffix', '_fix', 'test/fixtures/cli/fail_many.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command3-0] ____________ 1406s 1406s command = (, ['--fixed-suffix', '_fix', 'test/fixtures/linter/whitespace_errors.sql']) 1406s ret_code = 0 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['--fixed-suffix', '_fix', 'test/fixtures/linter/whitespace_errors.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command4-0] ____________ 1406s 1406s command = (, ['--fixed-suffix', '_fix', 'test/fixtures/linter/whitespace_errors.sql', '--persist-timing', 'test.csv']) 1406s ret_code = 0 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['--fixed-suffix', '_fix', 'test/fixtures/linter/whitespace_errors.sql', '--persist-timing', 'test.csv']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command5-2] ____________ 1406s 1406s command = (, ['--rules', 'LT01', '--fixed-suffix', '_fix', 'test/fixtures/linter/whitespace_errors.sql']) 1406s ret_code = 2 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2 1406s args = (, ['--rules', 'LT01', '--fixed-suffix', '_fix', 'test/fixtures/linter/whitespace_errors.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command6-1] ____________ 1406s 1406s command = (, ['test/fixtures/cli/unknown_jinja_tag/test.sql']) 1406s ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = (, ['test/fixtures/cli/unknown_jinja_tag/test.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command7-0] ____________ 1406s 1406s command = (, ['test/fixtures/cli/passing_a.sql', '--library-path', 'none']) 1406s ret_code = 0 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0 1406s args = (, ['test/fixtures/cli/passing_a.sql', '--library-path', 'none']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command8-1] ____________ 1406s 1406s command = (, ['test/fixtures/templater/jinja_r_library_in_macro/jinja.sql', '--library-path', 'none']) 1406s ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = (, ['test/fixtures/templater/jinja_r_library_in_macro/jinja.sql', '--library-path', 'none']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ____________ test__cli__command_lint_parse_with_retcode[command9-1] ____________ 1406s 1406s command = (, ['test/fixtures/cli/fail_many.sql']), ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1, args = (, ['test/fixtures/cli/fail_many.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________ test__cli__command_lint_parse_with_retcode[command10-1] ____________ 1406s 1406s command = (, ['test/fixtures/linter/autofix/bigquery/004_templating/before.sql', '--bench']) 1406s ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = (, ['test/fixtures/linter/autofix/bigquery/004_templating/before.sql', '--bench']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________ test__cli__command_lint_parse_with_retcode[command11-2] ____________ 1406s 1406s command = (, ['--quiet', '--verbose', 'test/fixtures/cli/fail_many.sql']) 1406s ret_code = 2 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 2 1406s args = (, ['--quiet', '--verbose', 'test/fixtures/cli/fail_many.sql']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________ test__cli__command_lint_parse_with_retcode[command12-1] ____________ 1406s 1406s command = (, ['test/fixtures/linter/parse_lex_error.sql', '-f', 'yaml']) 1406s ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = (, ['test/fixtures/linter/parse_lex_error.sql', '-f', 'yaml']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________ test__cli__command_lint_parse_with_retcode[command13-1] ____________ 1406s 1406s command = (, ['test/fixtures/cli/jinja_fatal_fail.sql', '-f', 'yaml']) 1406s ret_code = 1 1406s 1406s @pytest.mark.parametrize( 1406s "command, ret_code", 1406s [ 1406s # Check the script doesn't raise an unexpected exception with badly formed 1406s # files. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "test/fixtures/cli/fail_many.sql", 1406s "-vvvvvvv", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix with a suffixs 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Fix without specifying rules 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Format 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format with --persist-timing 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s "--persist-timing", 1406s "test.csv", 1406s ], 1406s ), 1406s 0, 1406s ), 1406s # Format (specifying rules) 1406s ( 1406s ( 1406s cli_format, 1406s [ 1406s "--rules", 1406s "LT01", 1406s "--fixed-suffix", 1406s "_fix", 1406s "test/fixtures/linter/whitespace_errors.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Template syntax error in macro file 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/unknown_jinja_tag/test.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test overriding library path when it doesn't cause an issue 1406s ( 1406s ( 1406s lint, 1406s ["test/fixtures/cli/passing_a.sql", "--library-path", "none"], 1406s ), 1406s 0, 1406s ), 1406s # Test overriding library path when it DOES cause an issue 1406s # (because macros won't be found). 1406s ( 1406s ( 1406s # Render because that's the step where the issue will 1406s # occur. 1406s render, 1406s [ 1406s "test/fixtures/templater/jinja_r_library_in_macro/jinja.sql", 1406s "--library-path", 1406s "none", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test render fail 1406s ( 1406s ( 1406s render, 1406s ["test/fixtures/cli/fail_many.sql"], 1406s ), 1406s 1, 1406s ), 1406s # Test a longer lint fail with --bench 1406s # This tests the threshold rules clause 1406s ( 1406s ( 1406s lint, 1406s [ 1406s "test/fixtures/linter/autofix/bigquery/004_templating/before.sql", 1406s "--bench", 1406s ], 1406s ), 1406s 1, 1406s ), 1406s # Test that setting --quiet with --verbose raises an error. 1406s ( 1406s ( 1406s fix, 1406s [ 1406s "--quiet", 1406s "--verbose", 1406s "test/fixtures/cli/fail_many.sql", 1406s ], 1406s ), 1406s 2, 1406s ), 1406s # Test machine format parse command with an unparsable file. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/linter/parse_lex_error.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s # Test machine format parse command with a fatal templating error. 1406s ( 1406s ( 1406s parse, 1406s ["test/fixtures/cli/jinja_fatal_fail.sql", "-f", "yaml"], 1406s ), 1406s 1, 1406s ), 1406s ], 1406s ) 1406s def test__cli__command_lint_parse_with_retcode(command, ret_code): 1406s """Check commands expecting a non-zero ret code.""" 1406s > invoke_assert_code(ret_code=ret_code, args=command) 1406s 1406s test/cli/commands_test.py:749: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = (, ['test/fixtures/cli/jinja_fatal_fail.sql', '-f', 'yaml']) 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___________________________ test__cli__command_rules ___________________________ 1406s 1406s def test__cli__command_rules(): 1406s """Check rules command for exceptions.""" 1406s > invoke_assert_code(args=[rules]) 1406s 1406s test/cli/commands_test.py:893: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = [], kwargs = {}, cli_input = None 1406s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _________________________ test__cli__command_dialects __________________________ 1406s 1406s def test__cli__command_dialects(): 1406s """Check dialects command for exceptions.""" 1406s > invoke_assert_code(args=[dialects]) 1406s 1406s test/cli/commands_test.py:898: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 0, args = [], kwargs = {}, cli_input = None 1406s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s __ test__cli__command__fix[LT01-test/fixtures/linter/indentation_errors.sql0] __ 1406s 1406s rule = 'LT01', fname = 'test/fixtures/linter/indentation_errors.sql' 1406s 1406s @pytest.mark.parametrize( 1406s "rule,fname", 1406s [ 1406s ("LT01", "test/fixtures/linter/indentation_errors.sql"), 1406s ("LT01", "test/fixtures/linter/whitespace_errors.sql"), 1406s ("LT01", "test/fixtures/linter/indentation_errors.sql"), 1406s # Really stretching the ability of the fixer to re-indent a file 1406s ("LT02", "test/fixtures/linter/indentation_error_hard.sql"), 1406s ], 1406s ) 1406s def test__cli__command__fix(rule, fname): 1406s """Test the round trip of detecting, fixing and then not detecting the rule.""" 1406s with open(fname) as test_file: 1406s > generic_roundtrip_test(test_file, rule) 1406s 1406s test/cli/commands_test.py:972: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s test/cli/commands_test.py:928: in generic_roundtrip_test 1406s invoke_assert_code( 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--dialect=ansi', '--rules', 'LT01', '/tmp/tmppnpa4axp/testing.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s ___ test__cli__command__fix[LT01-test/fixtures/linter/whitespace_errors.sql] ___ 1406s 1406s rule = 'LT01', fname = 'test/fixtures/linter/whitespace_errors.sql' 1406s 1406s @pytest.mark.parametrize( 1406s "rule,fname", 1406s [ 1406s ("LT01", "test/fixtures/linter/indentation_errors.sql"), 1406s ("LT01", "test/fixtures/linter/whitespace_errors.sql"), 1406s ("LT01", "test/fixtures/linter/indentation_errors.sql"), 1406s # Really stretching the ability of the fixer to re-indent a file 1406s ("LT02", "test/fixtures/linter/indentation_error_hard.sql"), 1406s ], 1406s ) 1406s def test__cli__command__fix(rule, fname): 1406s """Test the round trip of detecting, fixing and then not detecting the rule.""" 1406s with open(fname) as test_file: 1406s > generic_roundtrip_test(test_file, rule) 1406s 1406s test/cli/commands_test.py:972: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s test/cli/commands_test.py:928: in generic_roundtrip_test 1406s invoke_assert_code( 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--dialect=ansi', '--rules', 'LT01', '/tmp/tmpkhzgtfwa/testing.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s __ test__cli__command__fix[LT01-test/fixtures/linter/indentation_errors.sql1] __ 1406s 1406s rule = 'LT01', fname = 'test/fixtures/linter/indentation_errors.sql' 1406s 1406s @pytest.mark.parametrize( 1406s "rule,fname", 1406s [ 1406s ("LT01", "test/fixtures/linter/indentation_errors.sql"), 1406s ("LT01", "test/fixtures/linter/whitespace_errors.sql"), 1406s ("LT01", "test/fixtures/linter/indentation_errors.sql"), 1406s # Really stretching the ability of the fixer to re-indent a file 1406s ("LT02", "test/fixtures/linter/indentation_error_hard.sql"), 1406s ], 1406s ) 1406s def test__cli__command__fix(rule, fname): 1406s """Test the round trip of detecting, fixing and then not detecting the rule.""" 1406s with open(fname) as test_file: 1406s > generic_roundtrip_test(test_file, rule) 1406s 1406s test/cli/commands_test.py:972: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s test/cli/commands_test.py:928: in generic_roundtrip_test 1406s invoke_assert_code( 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--dialect=ansi', '--rules', 'LT01', '/tmp/tmpz94ntici/testing.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _ test__cli__command__fix[LT02-test/fixtures/linter/indentation_error_hard.sql] _ 1406s 1406s rule = 'LT02', fname = 'test/fixtures/linter/indentation_error_hard.sql' 1406s 1406s @pytest.mark.parametrize( 1406s "rule,fname", 1406s [ 1406s ("LT01", "test/fixtures/linter/indentation_errors.sql"), 1406s ("LT01", "test/fixtures/linter/whitespace_errors.sql"), 1406s ("LT01", "test/fixtures/linter/indentation_errors.sql"), 1406s # Really stretching the ability of the fixer to re-indent a file 1406s ("LT02", "test/fixtures/linter/indentation_error_hard.sql"), 1406s ], 1406s ) 1406s def test__cli__command__fix(rule, fname): 1406s """Test the round trip of detecting, fixing and then not detecting the rule.""" 1406s with open(fname) as test_file: 1406s > generic_roundtrip_test(test_file, rule) 1406s 1406s test/cli/commands_test.py:972: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s test/cli/commands_test.py:928: in generic_roundtrip_test 1406s invoke_assert_code( 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--dialect=ansi', '--rules', 'LT02', '/tmp/tmpbv19r9jt/testing.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _______________ test_cli_fix_even_unparsable[command-line-False] _______________ 1406s 1406s method = 'command-line', fix_even_unparsable = False 1406s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa8a235f0> 1406s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_cli_fix_even_unparsable_c0') 1406s 1406s @pytest.mark.parametrize( 1406s "method,fix_even_unparsable", 1406s [ 1406s ("command-line", False), 1406s ("command-line", True), 1406s ("config-file", False), 1406s ("config-file", True), 1406s ], 1406s ) 1406s def test_cli_fix_even_unparsable( 1406s method: str, fix_even_unparsable: bool, monkeypatch, tmpdir 1406s ): 1406s """Test the fix_even_unparsable option works from cmd line and config.""" 1406s sql_filename = "fix_even_unparsable.sql" 1406s sql_path = str(tmpdir / sql_filename) 1406s with open(sql_path, "w") as f: 1406s print( 1406s """SELECT my_col 1406s FROM my_schema.my_table 1406s where processdate ! 3 1406s """, 1406s file=f, 1406s ) 1406s options = [ 1406s "--dialect", 1406s "ansi", 1406s "--fixed-suffix=FIXED", 1406s sql_path, 1406s ] 1406s if method == "command-line": 1406s if fix_even_unparsable: 1406s options.append("--FIX-EVEN-UNPARSABLE") 1406s else: 1406s assert method == "config-file" 1406s with open(str(tmpdir / ".sqlfluff"), "w") as f: 1406s print( 1406s f"[sqlfluff]\nfix_even_unparsable = {fix_even_unparsable}", 1406s file=f, 1406s ) 1406s # TRICKY: Switch current directory to the one with the SQL file. Otherwise, 1406s # the setting doesn't work. That's because SQLFluff reads it in 1406s # sqlfluff.cli.commands.fix(), prior to reading any file-specific settings 1406s # (down in sqlfluff.core.linter.Linter._load_raw_file_and_config()). 1406s monkeypatch.chdir(str(tmpdir)) 1406s > invoke_assert_code( 1406s ret_code=0 if fix_even_unparsable else 1, 1406s args=[ 1406s fix, 1406s options, 1406s ], 1406s ) 1406s 1406s /tmp/autopkgtest.gvzmUI/autopkgtest_tmp/test/cli/commands_test.py:1178: 1406s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1406s 1406s ret_code = 1 1406s args = [, ['--dialect', 'ansi', '--fixed-suffix=FIXED', '/tmp/pytest-of-ubuntu/pytest-0/test_cli_fix_even_unparsable_c0/fix_even_unparsable.sql']] 1406s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1406s raise_exceptions = True 1406s 1406s def invoke_assert_code( 1406s ret_code: int = 0, 1406s args: Optional[List[Any]] = None, 1406s kwargs: Optional[Dict[str, Any]] = None, 1406s cli_input: Optional[str] = None, 1406s mix_stderr: bool = True, 1406s assert_output_contains: str = "", 1406s raise_exceptions: bool = True, 1406s ) -> Result: 1406s """Invoke a command and check return code.""" 1406s args = args or [] 1406s kwargs = kwargs or {} 1406s if cli_input: 1406s kwargs["input"] = cli_input 1406s > runner = CliRunner(mix_stderr=mix_stderr) 1406s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1406s 1406s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1406s _______________ test_cli_fix_even_unparsable[command-line-True] ________________ 1406s 1406s method = 'command-line', fix_even_unparsable = True 1406s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa8a222a0> 1406s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_cli_fix_even_unparsable_c1') 1406s 1406s @pytest.mark.parametrize( 1406s "method,fix_even_unparsable", 1406s [ 1406s ("command-line", False), 1406s ("command-line", True), 1406s ("config-file", False), 1406s ("config-file", True), 1406s ], 1406s ) 1406s def test_cli_fix_even_unparsable( 1406s method: str, fix_even_unparsable: bool, monkeypatch, tmpdir 1406s ): 1406s """Test the fix_even_unparsable option works from cmd line and config.""" 1406s sql_filename = "fix_even_unparsable.sql" 1406s sql_path = str(tmpdir / sql_filename) 1406s with open(sql_path, "w") as f: 1406s print( 1406s """SELECT my_col 1406s FROM my_schema.my_table 1406s where processdate ! 3 1406s """, 1406s file=f, 1406s ) 1406s options = [ 1406s "--dialect", 1406s "ansi", 1406s "--fixed-suffix=FIXED", 1406s sql_path, 1406s ] 1406s if method == "command-line": 1406s if fix_even_unparsable: 1406s options.append("--FIX-EVEN-UNPARSABLE") 1406s else: 1406s assert method == "config-file" 1406s with open(str(tmpdir / ".sqlfluff"), "w") as f: 1406s print( 1406s f"[sqlfluff]\nfix_even_unparsable = {fix_even_unparsable}", 1406s file=f, 1406s ) 1407s # TRICKY: Switch current directory to the one with the SQL file. Otherwise, 1407s # the setting doesn't work. That's because SQLFluff reads it in 1407s # sqlfluff.cli.commands.fix(), prior to reading any file-specific settings 1407s # (down in sqlfluff.core.linter.Linter._load_raw_file_and_config()). 1407s monkeypatch.chdir(str(tmpdir)) 1407s > invoke_assert_code( 1407s ret_code=0 if fix_even_unparsable else 1, 1407s args=[ 1407s fix, 1407s options, 1407s ], 1407s ) 1407s 1407s /tmp/autopkgtest.gvzmUI/autopkgtest_tmp/test/cli/commands_test.py:1178: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ['--dialect', 'ansi', '--fixed-suffix=FIXED', '/tmp/pytest-of-ubuntu/pytest-0/test_cli_fix_even_unparsable_c1/fix_even_unparsable.sql', '--FIX-EVEN-UNPARSABLE']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _______________ test_cli_fix_even_unparsable[config-file-False] ________________ 1407s 1407s method = 'config-file', fix_even_unparsable = False 1407s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa8a20a70> 1407s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_cli_fix_even_unparsable_c2') 1407s 1407s @pytest.mark.parametrize( 1407s "method,fix_even_unparsable", 1407s [ 1407s ("command-line", False), 1407s ("command-line", True), 1407s ("config-file", False), 1407s ("config-file", True), 1407s ], 1407s ) 1407s def test_cli_fix_even_unparsable( 1407s method: str, fix_even_unparsable: bool, monkeypatch, tmpdir 1407s ): 1407s """Test the fix_even_unparsable option works from cmd line and config.""" 1407s sql_filename = "fix_even_unparsable.sql" 1407s sql_path = str(tmpdir / sql_filename) 1407s with open(sql_path, "w") as f: 1407s print( 1407s """SELECT my_col 1407s FROM my_schema.my_table 1407s where processdate ! 3 1407s """, 1407s file=f, 1407s ) 1407s options = [ 1407s "--dialect", 1407s "ansi", 1407s "--fixed-suffix=FIXED", 1407s sql_path, 1407s ] 1407s if method == "command-line": 1407s if fix_even_unparsable: 1407s options.append("--FIX-EVEN-UNPARSABLE") 1407s else: 1407s assert method == "config-file" 1407s with open(str(tmpdir / ".sqlfluff"), "w") as f: 1407s print( 1407s f"[sqlfluff]\nfix_even_unparsable = {fix_even_unparsable}", 1407s file=f, 1407s ) 1407s # TRICKY: Switch current directory to the one with the SQL file. Otherwise, 1407s # the setting doesn't work. That's because SQLFluff reads it in 1407s # sqlfluff.cli.commands.fix(), prior to reading any file-specific settings 1407s # (down in sqlfluff.core.linter.Linter._load_raw_file_and_config()). 1407s monkeypatch.chdir(str(tmpdir)) 1407s > invoke_assert_code( 1407s ret_code=0 if fix_even_unparsable else 1, 1407s args=[ 1407s fix, 1407s options, 1407s ], 1407s ) 1407s 1407s /tmp/autopkgtest.gvzmUI/autopkgtest_tmp/test/cli/commands_test.py:1178: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--dialect', 'ansi', '--fixed-suffix=FIXED', '/tmp/pytest-of-ubuntu/pytest-0/test_cli_fix_even_unparsable_c2/fix_even_unparsable.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________________ test_cli_fix_even_unparsable[config-file-True] ________________ 1407s 1407s method = 'config-file', fix_even_unparsable = True 1407s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa8a0f470> 1407s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_cli_fix_even_unparsable_c3') 1407s 1407s @pytest.mark.parametrize( 1407s "method,fix_even_unparsable", 1407s [ 1407s ("command-line", False), 1407s ("command-line", True), 1407s ("config-file", False), 1407s ("config-file", True), 1407s ], 1407s ) 1407s def test_cli_fix_even_unparsable( 1407s method: str, fix_even_unparsable: bool, monkeypatch, tmpdir 1407s ): 1407s """Test the fix_even_unparsable option works from cmd line and config.""" 1407s sql_filename = "fix_even_unparsable.sql" 1407s sql_path = str(tmpdir / sql_filename) 1407s with open(sql_path, "w") as f: 1407s print( 1407s """SELECT my_col 1407s FROM my_schema.my_table 1407s where processdate ! 3 1407s """, 1407s file=f, 1407s ) 1407s options = [ 1407s "--dialect", 1407s "ansi", 1407s "--fixed-suffix=FIXED", 1407s sql_path, 1407s ] 1407s if method == "command-line": 1407s if fix_even_unparsable: 1407s options.append("--FIX-EVEN-UNPARSABLE") 1407s else: 1407s assert method == "config-file" 1407s with open(str(tmpdir / ".sqlfluff"), "w") as f: 1407s print( 1407s f"[sqlfluff]\nfix_even_unparsable = {fix_even_unparsable}", 1407s file=f, 1407s ) 1407s # TRICKY: Switch current directory to the one with the SQL file. Otherwise, 1407s # the setting doesn't work. That's because SQLFluff reads it in 1407s # sqlfluff.cli.commands.fix(), prior to reading any file-specific settings 1407s # (down in sqlfluff.core.linter.Linter._load_raw_file_and_config()). 1407s monkeypatch.chdir(str(tmpdir)) 1407s > invoke_assert_code( 1407s ret_code=0 if fix_even_unparsable else 1, 1407s args=[ 1407s fix, 1407s options, 1407s ], 1407s ) 1407s 1407s /tmp/autopkgtest.gvzmUI/autopkgtest_tmp/test/cli/commands_test.py:1178: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ['--dialect', 'ansi', '--fixed-suffix=FIXED', '/tmp/pytest-of-ubuntu/pytest-0/test_cli_fix_even_unparsable_c3/fix_even_unparsable.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ______ test__cli__command_fix_stdin[select * from t-LT02-select * from t] ______ 1407s 1407s stdin = 'select * from t', rules = 'LT02', stdout = 'select * from t' 1407s 1407s @pytest.mark.parametrize( 1407s "stdin,rules,stdout", 1407s [ 1407s ("select * from t", "LT02", "select * from t"), # no change 1407s ( 1407s " select * from t", 1407s "LT02", 1407s "select * from t", 1407s ), # fix preceding whitespace 1407s ], 1407s ) 1407s def test__cli__command_fix_stdin(stdin, rules, stdout): 1407s """Check stdin input for fix works.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s fix, 1407s ("-", "--rules", rules, "--disable-progress-bar", "--dialect=ansi"), 1407s ], 1407s cli_input=stdin, 1407s ) 1407s 1407s test/cli/commands_test.py:1213: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--rules', 'LT02', '--disable-progress-bar', '--dialect=ansi')] 1407s kwargs = {'input': 'select * from t'}, cli_input = 'select * from t' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _____ test__cli__command_fix_stdin[ select * from t-LT02-select * from t] ______ 1407s 1407s stdin = ' select * from t', rules = 'LT02', stdout = 'select * from t' 1407s 1407s @pytest.mark.parametrize( 1407s "stdin,rules,stdout", 1407s [ 1407s ("select * from t", "LT02", "select * from t"), # no change 1407s ( 1407s " select * from t", 1407s "LT02", 1407s "select * from t", 1407s ), # fix preceding whitespace 1407s ], 1407s ) 1407s def test__cli__command_fix_stdin(stdin, rules, stdout): 1407s """Check stdin input for fix works.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s fix, 1407s ("-", "--rules", rules, "--disable-progress-bar", "--dialect=ansi"), 1407s ], 1407s cli_input=stdin, 1407s ) 1407s 1407s test/cli/commands_test.py:1213: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--rules', 'LT02', '--disable-progress-bar', '--dialect=ansi')] 1407s kwargs = {'input': ' select * from t'}, cli_input = ' select * from t' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _____ test__cli__command_format_stdin[select * from t\n-select * from t\n] _____ 1407s 1407s stdin = 'select * from t\n', stdout = 'select * from t\n' 1407s 1407s @pytest.mark.parametrize( 1407s "stdin,stdout", 1407s [ 1407s ("select * from t\n", "select * from t\n"), # no change 1407s ( 1407s " select * FRoM t ", 1407s "select * from t\n", 1407s ), 1407s ( 1407s # Check that warnings related to parsing errors on input don't 1407s # go to stdout. This query shouldn't change, but stdout should 1407s # remain clean. 1407s # https://github.com/sqlfluff/sqlfluff/issues/5327 1407s "select\n" 1407s " count(*) over (\n" 1407s " order by a desc \n" 1407s " range between b row and '10 seconds' following -- noqa: PRS\n" 1407s " ) as c\n" 1407s "from d\n", 1407s "select\n" 1407s " count(*) over (\n" 1407s " order by a desc \n" 1407s " range between b row and '10 seconds' following -- noqa: PRS\n" 1407s " ) as c\n" 1407s "from d\n", 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_format_stdin(stdin, stdout): 1407s """Check stdin input for fix works.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s cli_format, 1407s ("-", "--disable-progress-bar", "--dialect=ansi"), 1407s ], 1407s cli_input=stdin, 1407s mix_stderr=False, 1407s ) 1407s 1407s test/cli/commands_test.py:1253: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--disable-progress-bar', '--dialect=ansi')] 1407s kwargs = {'input': 'select * from t\n'}, cli_input = 'select * from t\n' 1407s mix_stderr = False, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_format_stdin[ select * FRoM t -select * from t\n] _ 1407s 1407s stdin = ' select * FRoM t ', stdout = 'select * from t\n' 1407s 1407s @pytest.mark.parametrize( 1407s "stdin,stdout", 1407s [ 1407s ("select * from t\n", "select * from t\n"), # no change 1407s ( 1407s " select * FRoM t ", 1407s "select * from t\n", 1407s ), 1407s ( 1407s # Check that warnings related to parsing errors on input don't 1407s # go to stdout. This query shouldn't change, but stdout should 1407s # remain clean. 1407s # https://github.com/sqlfluff/sqlfluff/issues/5327 1407s "select\n" 1407s " count(*) over (\n" 1407s " order by a desc \n" 1407s " range between b row and '10 seconds' following -- noqa: PRS\n" 1407s " ) as c\n" 1407s "from d\n", 1407s "select\n" 1407s " count(*) over (\n" 1407s " order by a desc \n" 1407s " range between b row and '10 seconds' following -- noqa: PRS\n" 1407s " ) as c\n" 1407s "from d\n", 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_format_stdin(stdin, stdout): 1407s """Check stdin input for fix works.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s cli_format, 1407s ("-", "--disable-progress-bar", "--dialect=ansi"), 1407s ], 1407s cli_input=stdin, 1407s mix_stderr=False, 1407s ) 1407s 1407s test/cli/commands_test.py:1253: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--disable-progress-bar', '--dialect=ansi')] 1407s kwargs = {'input': ' select * FRoM t '} 1407s cli_input = ' select * FRoM t ', mix_stderr = False 1407s assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_format_stdin[select\n count(*) over (\n order by a desc \n range between b row and '10 seconds' following -- noqa: PRS\n ) as c\nfrom d\n-select\n count(*) over (\n order by a desc \n range between b row and '10 seconds' following -- noqa: PRS\n ) as c\nfrom d\n] _ 1407s 1407s stdin = "select\n count(*) over (\n order by a desc \n range between b row and '10 seconds' following -- noqa: PRS\n ) as c\nfrom d\n" 1407s stdout = "select\n count(*) over (\n order by a desc \n range between b row and '10 seconds' following -- noqa: PRS\n ) as c\nfrom d\n" 1407s 1407s @pytest.mark.parametrize( 1407s "stdin,stdout", 1407s [ 1407s ("select * from t\n", "select * from t\n"), # no change 1407s ( 1407s " select * FRoM t ", 1407s "select * from t\n", 1407s ), 1407s ( 1407s # Check that warnings related to parsing errors on input don't 1407s # go to stdout. This query shouldn't change, but stdout should 1407s # remain clean. 1407s # https://github.com/sqlfluff/sqlfluff/issues/5327 1407s "select\n" 1407s " count(*) over (\n" 1407s " order by a desc \n" 1407s " range between b row and '10 seconds' following -- noqa: PRS\n" 1407s " ) as c\n" 1407s "from d\n", 1407s "select\n" 1407s " count(*) over (\n" 1407s " order by a desc \n" 1407s " range between b row and '10 seconds' following -- noqa: PRS\n" 1407s " ) as c\n" 1407s "from d\n", 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_format_stdin(stdin, stdout): 1407s """Check stdin input for fix works.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s cli_format, 1407s ("-", "--disable-progress-bar", "--dialect=ansi"), 1407s ], 1407s cli_input=stdin, 1407s mix_stderr=False, 1407s ) 1407s 1407s test/cli/commands_test.py:1253: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--disable-progress-bar', '--dialect=ansi')] 1407s kwargs = {'input': "select\n count(*) over (\n order by a desc \n range between b row and '10 seconds' following -- noqa: PRS\n ) as c\nfrom d\n"} 1407s cli_input = "select\n count(*) over (\n order by a desc \n range between b row and '10 seconds' following -- noqa: PRS\n ) as c\nfrom d\n" 1407s mix_stderr = False, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________________ test__cli__command_fix_stdin_logging_to_stderr ________________ 1407s 1407s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa8a0c260> 1407s 1407s def test__cli__command_fix_stdin_logging_to_stderr(monkeypatch): 1407s """Check that logging goes to stderr when stdin is passed to fix.""" 1407s perfect_sql = "select col from table" 1407s 1407s class MockLinter(sqlfluff.core.Linter): 1407s @classmethod 1407s def lint_fix_parsed(cls, *args, **kwargs): 1407s cls._warn_unfixable("") 1407s return super().lint_fix_parsed(*args, **kwargs) 1407s 1407s monkeypatch.setattr(sqlfluff.cli.commands, "Linter", MockLinter) 1407s > result = invoke_assert_code( 1407s args=[fix, ("-", "--rules=LT02", "--dialect=ansi")], 1407s cli_input=perfect_sql, 1407s mix_stderr=False, 1407s ) 1407s 1407s test/cli/commands_test.py:1275: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0, args = [, ('-', '--rules=LT02', '--dialect=ansi')] 1407s kwargs = {'input': 'select col from table'}, cli_input = 'select col from table' 1407s mix_stderr = False, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _____________________ test__cli__command_fix_stdin_safety ______________________ 1407s 1407s def test__cli__command_fix_stdin_safety(): 1407s """Check edge cases regarding safety when fixing stdin.""" 1407s perfect_sql = "select col from table" 1407s 1407s # just prints the very same thing 1407s > result = invoke_assert_code( 1407s args=[fix, ("-", "--disable-progress-bar", "--dialect=ansi")], 1407s cli_input=perfect_sql, 1407s ) 1407s 1407s test/cli/commands_test.py:1290: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--disable-progress-bar', '--dialect=ansi')] 1407s kwargs = {'input': 'select col from table'}, cli_input = 'select col from table' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_fix_stdin_error_exit_code[create TABLE {{ params.dsfsdfds }}.t (a int)-1--v-Fix aborted due to unparsable template variables.] _ 1407s 1407s sql = 'create TABLE {{ params.dsfsdfds }}.t (a int)', exit_code = 1 1407s params = '-v' 1407s assert_output_contains = 'Fix aborted due to unparsable template variables.' 1407s 1407s @pytest.mark.parametrize( 1407s "sql,exit_code,params,assert_output_contains", 1407s [ 1407s ( 1407s "create TABLE {{ params.dsfsdfds }}.t (a int)", 1407s 1, 1407s "-v", 1407s "Fix aborted due to unparsable template variables.", 1407s ), # template error 1407s ("create TABLE a.t (a int)", 0, "", ""), # fixable error 1407s ("create table a.t (a int)", 0, "", ""), # perfection 1407s ( 1407s "select col from a join b using (c)", 1407s 1, 1407s "-v", 1407s "Unfixable violations detected.", 1407s ), # unfixable error (using) 1407s ], 1407s ) 1407s def test__cli__command_fix_stdin_error_exit_code( 1407s sql, exit_code, params, assert_output_contains 1407s ): 1407s """Check that the CLI fails nicely if fixing a templated stdin.""" 1407s > invoke_assert_code( 1407s ret_code=exit_code, 1407s args=[fix, ((params,) if params else ()) + ("--dialect=ansi", "-")], 1407s cli_input=sql, 1407s assert_output_contains=assert_output_contains, 1407s ) 1407s 1407s test/cli/commands_test.py:1320: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1, args = [, ('-v', '--dialect=ansi', '-')] 1407s kwargs = {'input': 'create TABLE {{ params.dsfsdfds }}.t (a int)'} 1407s cli_input = 'create TABLE {{ params.dsfsdfds }}.t (a int)', mix_stderr = True 1407s assert_output_contains = 'Fix aborted due to unparsable template variables.' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __ test__cli__command_fix_stdin_error_exit_code[create TABLE a.t (a int)-0--] __ 1407s 1407s sql = 'create TABLE a.t (a int)', exit_code = 0, params = '' 1407s assert_output_contains = '' 1407s 1407s @pytest.mark.parametrize( 1407s "sql,exit_code,params,assert_output_contains", 1407s [ 1407s ( 1407s "create TABLE {{ params.dsfsdfds }}.t (a int)", 1407s 1, 1407s "-v", 1407s "Fix aborted due to unparsable template variables.", 1407s ), # template error 1407s ("create TABLE a.t (a int)", 0, "", ""), # fixable error 1407s ("create table a.t (a int)", 0, "", ""), # perfection 1407s ( 1407s "select col from a join b using (c)", 1407s 1, 1407s "-v", 1407s "Unfixable violations detected.", 1407s ), # unfixable error (using) 1407s ], 1407s ) 1407s def test__cli__command_fix_stdin_error_exit_code( 1407s sql, exit_code, params, assert_output_contains 1407s ): 1407s """Check that the CLI fails nicely if fixing a templated stdin.""" 1407s > invoke_assert_code( 1407s ret_code=exit_code, 1407s args=[fix, ((params,) if params else ()) + ("--dialect=ansi", "-")], 1407s cli_input=sql, 1407s assert_output_contains=assert_output_contains, 1407s ) 1407s 1407s test/cli/commands_test.py:1320: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0, args = [, ('--dialect=ansi', '-')] 1407s kwargs = {'input': 'create TABLE a.t (a int)'} 1407s cli_input = 'create TABLE a.t (a int)', mix_stderr = True 1407s assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __ test__cli__command_fix_stdin_error_exit_code[create table a.t (a int)-0--] __ 1407s 1407s sql = 'create table a.t (a int)', exit_code = 0, params = '' 1407s assert_output_contains = '' 1407s 1407s @pytest.mark.parametrize( 1407s "sql,exit_code,params,assert_output_contains", 1407s [ 1407s ( 1407s "create TABLE {{ params.dsfsdfds }}.t (a int)", 1407s 1, 1407s "-v", 1407s "Fix aborted due to unparsable template variables.", 1407s ), # template error 1407s ("create TABLE a.t (a int)", 0, "", ""), # fixable error 1407s ("create table a.t (a int)", 0, "", ""), # perfection 1407s ( 1407s "select col from a join b using (c)", 1407s 1, 1407s "-v", 1407s "Unfixable violations detected.", 1407s ), # unfixable error (using) 1407s ], 1407s ) 1407s def test__cli__command_fix_stdin_error_exit_code( 1407s sql, exit_code, params, assert_output_contains 1407s ): 1407s """Check that the CLI fails nicely if fixing a templated stdin.""" 1407s > invoke_assert_code( 1407s ret_code=exit_code, 1407s args=[fix, ((params,) if params else ()) + ("--dialect=ansi", "-")], 1407s cli_input=sql, 1407s assert_output_contains=assert_output_contains, 1407s ) 1407s 1407s test/cli/commands_test.py:1320: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0, args = [, ('--dialect=ansi', '-')] 1407s kwargs = {'input': 'create table a.t (a int)'} 1407s cli_input = 'create table a.t (a int)', mix_stderr = True 1407s assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_fix_stdin_error_exit_code[select col from a join b using (c)-1--v-Unfixable violations detected.] _ 1407s 1407s sql = 'select col from a join b using (c)', exit_code = 1, params = '-v' 1407s assert_output_contains = 'Unfixable violations detected.' 1407s 1407s @pytest.mark.parametrize( 1407s "sql,exit_code,params,assert_output_contains", 1407s [ 1407s ( 1407s "create TABLE {{ params.dsfsdfds }}.t (a int)", 1407s 1, 1407s "-v", 1407s "Fix aborted due to unparsable template variables.", 1407s ), # template error 1407s ("create TABLE a.t (a int)", 0, "", ""), # fixable error 1407s ("create table a.t (a int)", 0, "", ""), # perfection 1407s ( 1407s "select col from a join b using (c)", 1407s 1, 1407s "-v", 1407s "Unfixable violations detected.", 1407s ), # unfixable error (using) 1407s ], 1407s ) 1407s def test__cli__command_fix_stdin_error_exit_code( 1407s sql, exit_code, params, assert_output_contains 1407s ): 1407s """Check that the CLI fails nicely if fixing a templated stdin.""" 1407s > invoke_assert_code( 1407s ret_code=exit_code, 1407s args=[fix, ((params,) if params else ()) + ("--dialect=ansi", "-")], 1407s cli_input=sql, 1407s assert_output_contains=assert_output_contains, 1407s ) 1407s 1407s test/cli/commands_test.py:1320: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1, args = [, ('-v', '--dialect=ansi', '-')] 1407s kwargs = {'input': 'select col from a join b using (c)'} 1407s cli_input = 'select col from a join b using (c)', mix_stderr = True 1407s assert_output_contains = 'Unfixable violations detected.' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command__fix_check[LT01-test/fixtures/linter/indentation_errors.sql-y-0-0] _ 1407s 1407s rule = 'LT01', fname = 'test/fixtures/linter/indentation_errors.sql' 1407s prompt = 'y', exit_code = 0, fix_exit_code = 0 1407s 1407s @pytest.mark.parametrize( 1407s "rule,fname,prompt,exit_code,fix_exit_code", 1407s [ 1407s ("LT01", "test/fixtures/linter/indentation_errors.sql", "y", 0, 0), 1407s ("LT01", "test/fixtures/linter/indentation_errors.sql", "n", 1, 1), 1407s ], 1407s ) 1407s def test__cli__command__fix_check(rule, fname, prompt, exit_code, fix_exit_code): 1407s """Round trip test, using the prompts.""" 1407s with open(fname) as test_file: 1407s > generic_roundtrip_test( 1407s test_file, 1407s rule, 1407s check=True, 1407s final_exit_code=exit_code, 1407s fix_input=prompt, 1407s fix_exit_code=fix_exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1338: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s test/cli/commands_test.py:928: in generic_roundtrip_test 1407s invoke_assert_code( 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--dialect=ansi', '--rules', 'LT01', '/tmp/tmpoejvbfw0/testing.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command__fix_check[LT01-test/fixtures/linter/indentation_errors.sql-n-1-1] _ 1407s 1407s rule = 'LT01', fname = 'test/fixtures/linter/indentation_errors.sql' 1407s prompt = 'n', exit_code = 1, fix_exit_code = 1 1407s 1407s @pytest.mark.parametrize( 1407s "rule,fname,prompt,exit_code,fix_exit_code", 1407s [ 1407s ("LT01", "test/fixtures/linter/indentation_errors.sql", "y", 0, 0), 1407s ("LT01", "test/fixtures/linter/indentation_errors.sql", "n", 1, 1), 1407s ], 1407s ) 1407s def test__cli__command__fix_check(rule, fname, prompt, exit_code, fix_exit_code): 1407s """Round trip test, using the prompts.""" 1407s with open(fname) as test_file: 1407s > generic_roundtrip_test( 1407s test_file, 1407s rule, 1407s check=True, 1407s final_exit_code=exit_code, 1407s fix_input=prompt, 1407s fix_exit_code=fix_exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1338: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s test/cli/commands_test.py:928: in generic_roundtrip_test 1407s invoke_assert_code( 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--dialect=ansi', '--rules', 'LT01', '/tmp/tmp5hgdu6p8/testing.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ___________ test__cli__command_parse_serialize_from_stdin[None-yaml] ___________ 1407s 1407s serialize = 'yaml', write_file = None 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_parse_seria0') 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json"]) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_parse_serialize_from_stdin(serialize, write_file, tmp_path): 1407s """Check that the parser serialized output option is working. 1407s 1407s This tests both output to stdout and output to file. 1407s 1407s Not going to test for the content of the output as that is subject to change. 1407s """ 1407s cmd_args = ("-", "--format", serialize, "--dialect=ansi") 1407s 1407s if write_file: 1407s target_file = os.path.join(tmp_path, write_file + "." + serialize) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s > result = invoke_assert_code( 1407s args=[parse, cmd_args], 1407s cli_input="select * from tbl", 1407s ) 1407s 1407s test/cli/commands_test.py:1363: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--format', 'yaml', '--dialect=ansi')] 1407s kwargs = {'input': 'select * from tbl'}, cli_input = 'select * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ___________ test__cli__command_parse_serialize_from_stdin[None-json] ___________ 1407s 1407s serialize = 'json', write_file = None 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_parse_seria1') 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json"]) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_parse_serialize_from_stdin(serialize, write_file, tmp_path): 1407s """Check that the parser serialized output option is working. 1407s 1407s This tests both output to stdout and output to file. 1407s 1407s Not going to test for the content of the output as that is subject to change. 1407s """ 1407s cmd_args = ("-", "--format", serialize, "--dialect=ansi") 1407s 1407s if write_file: 1407s target_file = os.path.join(tmp_path, write_file + "." + serialize) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s > result = invoke_assert_code( 1407s args=[parse, cmd_args], 1407s cli_input="select * from tbl", 1407s ) 1407s 1407s test/cli/commands_test.py:1363: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--format', 'json', '--dialect=ansi')] 1407s kwargs = {'input': 'select * from tbl'}, cli_input = 'select * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________ test__cli__command_parse_serialize_from_stdin[outfile-yaml] __________ 1407s 1407s serialize = 'yaml', write_file = 'outfile' 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_parse_seria2') 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json"]) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_parse_serialize_from_stdin(serialize, write_file, tmp_path): 1407s """Check that the parser serialized output option is working. 1407s 1407s This tests both output to stdout and output to file. 1407s 1407s Not going to test for the content of the output as that is subject to change. 1407s """ 1407s cmd_args = ("-", "--format", serialize, "--dialect=ansi") 1407s 1407s if write_file: 1407s target_file = os.path.join(tmp_path, write_file + "." + serialize) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s > result = invoke_assert_code( 1407s args=[parse, cmd_args], 1407s cli_input="select * from tbl", 1407s ) 1407s 1407s test/cli/commands_test.py:1363: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--format', 'yaml', '--dialect=ansi', '--write-output', '/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_parse_seria2/outfile.yaml')] 1407s kwargs = {'input': 'select * from tbl'}, cli_input = 'select * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________ test__cli__command_parse_serialize_from_stdin[outfile-json] __________ 1407s 1407s serialize = 'json', write_file = 'outfile' 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_parse_seria3') 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json"]) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_parse_serialize_from_stdin(serialize, write_file, tmp_path): 1407s """Check that the parser serialized output option is working. 1407s 1407s This tests both output to stdout and output to file. 1407s 1407s Not going to test for the content of the output as that is subject to change. 1407s """ 1407s cmd_args = ("-", "--format", serialize, "--dialect=ansi") 1407s 1407s if write_file: 1407s target_file = os.path.join(tmp_path, write_file + "." + serialize) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s > result = invoke_assert_code( 1407s args=[parse, cmd_args], 1407s cli_input="select * from tbl", 1407s ) 1407s 1407s test/cli/commands_test.py:1363: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--format', 'json', '--dialect=ansi', '--write-output', '/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_parse_seria3/outfile.json')] 1407s kwargs = {'input': 'select * from tbl'}, cli_input = 'select * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[select * from tbl-CP01-expected0-0-yaml] _ 1407s 1407s serialize = 'yaml', sql = 'select * from tbl', rules = 'CP01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 12, 'segments': 24, 'source_chars': 17, 'templated_chars': 17}, 'violations': []}] 1407s exit_code = 0 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--rules', 'CP01', '--format', 'yaml', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'select * from tbl'}, cli_input = 'select * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[select * from tbl-CP01-expected0-0-json] _ 1407s 1407s serialize = 'json', sql = 'select * from tbl', rules = 'CP01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 12, 'segments': 24, 'source_chars': 17, 'templated_chars': 17}, 'violations': []}] 1407s exit_code = 0 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--rules', 'CP01', '--format', 'json', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'select * from tbl'}, cli_input = 'select * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[select * from tbl-CP01-expected0-0-none] _ 1407s 1407s serialize = 'none', sql = 'select * from tbl', rules = 'CP01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 12, 'segments': 24, 'source_chars': 17, 'templated_chars': 17}, 'violations': []}] 1407s exit_code = 0 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ('-', '--rules', 'CP01', '--format', 'none', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'select * from tbl'}, cli_input = 'select * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[SElect * from tbl-CP01-expected1-1-yaml] _ 1407s 1407s serialize = 'yaml', sql = 'SElect * from tbl', rules = 'CP01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 12, 'segments': 24, 'source_chars': 17, 'templated_chars': 17}, ...ode': 'CP01', 'description': 'Keywords must be consistently upper case.', 'end_file_pos': 13, 'end_line_no': 1, ...}]}] 1407s exit_code = 1 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('-', '--rules', 'CP01', '--format', 'yaml', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'SElect * from tbl'}, cli_input = 'SElect * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[SElect * from tbl-CP01-expected1-1-json] _ 1407s 1407s serialize = 'json', sql = 'SElect * from tbl', rules = 'CP01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 12, 'segments': 24, 'source_chars': 17, 'templated_chars': 17}, ...ode': 'CP01', 'description': 'Keywords must be consistently upper case.', 'end_file_pos': 13, 'end_line_no': 1, ...}]}] 1407s exit_code = 1 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('-', '--rules', 'CP01', '--format', 'json', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'SElect * from tbl'}, cli_input = 'SElect * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[SElect * from tbl-CP01-expected1-1-none] _ 1407s 1407s serialize = 'none', sql = 'SElect * from tbl', rules = 'CP01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 12, 'segments': 24, 'source_chars': 17, 'templated_chars': 17}, ...ode': 'CP01', 'description': 'Keywords must be consistently upper case.', 'end_file_pos': 13, 'end_line_no': 1, ...}]}] 1407s exit_code = 1 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('-', '--rules', 'CP01', '--format', 'none', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'SElect * from tbl'}, cli_input = 'SElect * from tbl' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[SELECT {{1}}-JJ01-expected2-1-yaml] _ 1407s 1407s serialize = 'yaml', sql = 'SELECT {{1}}', rules = 'JJ01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 6, 'segments': 11, 'source_chars': 12, 'templated_chars': 8}, 'v...ion': 'Jinja tags should have a single whitespace on either side: {{1}}', 'end_file_pos': 12, 'end_line_no': 1, ...}]}] 1407s exit_code = 1 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('-', '--rules', 'JJ01', '--format', 'yaml', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'SELECT {{1}}'}, cli_input = 'SELECT {{1}}' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[SELECT {{1}}-JJ01-expected2-1-json] _ 1407s 1407s serialize = 'json', sql = 'SELECT {{1}}', rules = 'JJ01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 6, 'segments': 11, 'source_chars': 12, 'templated_chars': 8}, 'v...ion': 'Jinja tags should have a single whitespace on either side: {{1}}', 'end_file_pos': 12, 'end_line_no': 1, ...}]}] 1407s exit_code = 1 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('-', '--rules', 'JJ01', '--format', 'json', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'SELECT {{1}}'}, cli_input = 'SELECT {{1}}' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_from_stdin[SELECT {{1}}-JJ01-expected2-1-none] _ 1407s 1407s serialize = 'none', sql = 'SELECT {{1}}', rules = 'JJ01' 1407s expected = [{'filepath': 'stdin', 'statistics': {'raw_segments': 6, 'segments': 11, 'source_chars': 12, 'templated_chars': 8}, 'v...ion': 'Jinja tags should have a single whitespace on either side: {{1}}', 'end_file_pos': 12, 'end_line_no': 1, ...}]}] 1407s exit_code = 1 1407s 1407s @pytest.mark.parametrize("serialize", ["yaml", "json", "none"]) 1407s @pytest.mark.parametrize( 1407s "sql,rules,expected,exit_code", 1407s [ 1407s ( 1407s "select * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # Empty list because no violations. 1407s "violations": [], 1407s } 1407s ], 1407s 0, 1407s ), 1407s ( 1407s "SElect * from tbl", 1407s "CP01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "SELECT", 1407s "start_line_no": 1, 1407s "start_line_pos": 1, 1407s "start_file_pos": 0, 1407s "end_line_no": 1, 1407s "end_line_pos": 7, 1407s "end_file_pos": 6, 1407s } 1407s ], 1407s }, 1407s { 1407s "code": "CP01", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s "description": "Keywords must be consistently upper case.", 1407s "name": "capitalisation.keywords", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "FROM", 1407s "start_line_no": 1, 1407s "start_line_pos": 10, 1407s "start_file_pos": 9, 1407s "end_line_no": 1, 1407s "end_line_pos": 14, 1407s "end_file_pos": 13, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 12, 1407s "segments": 24, 1407s "source_chars": 17, 1407s "templated_chars": 17, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s # Test serialisation with a source only fix. 1407s ( 1407s "SELECT {{1}}", 1407s "JJ01", 1407s [ 1407s { 1407s "filepath": "stdin", 1407s "violations": [ 1407s { 1407s "code": "JJ01", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s "description": ( 1407s "Jinja tags should have a single whitespace on " 1407s "either side: {{1}}" 1407s ), 1407s "name": "jinja.padding", 1407s "warning": False, 1407s "fixes": [ 1407s { 1407s "type": "replace", 1407s "edit": "{{ 1 }}", 1407s "start_line_no": 1, 1407s "start_line_pos": 8, 1407s "start_file_pos": 7, 1407s "end_line_no": 1, 1407s "end_line_pos": 13, 1407s "end_file_pos": 12, 1407s } 1407s ], 1407s }, 1407s ], 1407s "statistics": { 1407s "raw_segments": 6, 1407s "segments": 11, 1407s "source_chars": 12, 1407s "templated_chars": 8, 1407s }, 1407s # NOTE: There will be a timings section too, but we're not 1407s # going to test that. 1407s } 1407s ], 1407s 1, 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_from_stdin( 1407s serialize, sql, rules, expected, exit_code 1407s ): 1407s """Check an explicit serialized return value for a single error.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s "-", 1407s "--rules", 1407s rules, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s "--dialect=ansi", 1407s ), 1407s ], 1407s cli_input=sql, 1407s ret_code=exit_code, 1407s ) 1407s 1407s test/cli/commands_test.py:1528: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('-', '--rules', 'JJ01', '--format', 'none', '--disable-progress-bar', ...)] 1407s kwargs = {'input': 'SELECT {{1}}'}, cli_input = 'SELECT {{1}}' 1407s mix_stderr = True, assert_output_contains = '', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _______________ test__cli__command_fail_nice_not_found[command0] _______________ 1407s 1407s command = [, 'this_file_does_not_exist.sql'] 1407s 1407s @pytest.mark.parametrize( 1407s "command", 1407s [ 1407s [lint, ("this_file_does_not_exist.sql")], 1407s [fix, ("this_file_does_not_exist.sql")], 1407s ], 1407s ) 1407s def test__cli__command_fail_nice_not_found(command): 1407s """Check commands fail as expected when then don't find files.""" 1407s > invoke_assert_code( 1407s args=command, 1407s ret_code=2, 1407s assert_output_contains=( 1407s "User Error: Specified path does not exist. Check it/they " 1407s "exist(s): this_file_does_not_exist.sql" 1407s ), 1407s ) 1407s 1407s test/cli/commands_test.py:1574: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 2, args = [, 'this_file_does_not_exist.sql'] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = 'User Error: Specified path does not exist. Check it/they exist(s): this_file_does_not_exist.sql' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _______________ test__cli__command_fail_nice_not_found[command1] _______________ 1407s 1407s command = [, 'this_file_does_not_exist.sql'] 1407s 1407s @pytest.mark.parametrize( 1407s "command", 1407s [ 1407s [lint, ("this_file_does_not_exist.sql")], 1407s [fix, ("this_file_does_not_exist.sql")], 1407s ], 1407s ) 1407s def test__cli__command_fail_nice_not_found(command): 1407s """Check commands fail as expected when then don't find files.""" 1407s > invoke_assert_code( 1407s args=command, 1407s ret_code=2, 1407s assert_output_contains=( 1407s "User Error: Specified path does not exist. Check it/they " 1407s "exist(s): this_file_does_not_exist.sql" 1407s ), 1407s ) 1407s 1407s test/cli/commands_test.py:1574: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 2, args = [, 'this_file_does_not_exist.sql'] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = 'User Error: Specified path does not exist. Check it/they exist(s): this_file_does_not_exist.sql' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________ test__cli__command_lint_serialize_multiple_files[None-human] _________ 1407s 1407s serialize = 'human', write_file = None 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial0') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'human', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________ test__cli__command_lint_serialize_multiple_files[None-yaml] __________ 1407s 1407s serialize = 'yaml', write_file = None 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial1') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'yaml', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________ test__cli__command_lint_serialize_multiple_files[None-json] __________ 1407s 1407s serialize = 'json', write_file = None 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial2') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'json', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ___ test__cli__command_lint_serialize_multiple_files[None-github-annotation] ___ 1407s 1407s serialize = 'github-annotation', write_file = None 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial3') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'github-annotation', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_multiple_files[None-github-annotation-native] _ 1407s 1407s serialize = 'github-annotation-native', write_file = None 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial4') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'github-annotation-native', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________ test__cli__command_lint_serialize_multiple_files[None-none] __________ 1407s 1407s serialize = 'none', write_file = None 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial5') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'none', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _______ test__cli__command_lint_serialize_multiple_files[outfile-human] ________ 1407s 1407s serialize = 'human', write_file = 'outfile' 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial6') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'human', '--disable-progress-bar', '--write-output', ...)] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________ test__cli__command_lint_serialize_multiple_files[outfile-yaml] ________ 1407s 1407s serialize = 'yaml', write_file = 'outfile' 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial7') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'yaml', '--disable-progress-bar', '--write-output', ...)] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________ test__cli__command_lint_serialize_multiple_files[outfile-json] ________ 1407s 1407s serialize = 'json', write_file = 'outfile' 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial8') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'json', '--disable-progress-bar', '--write-output', ...)] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_multiple_files[outfile-github-annotation] __ 1407s 1407s serialize = 'github-annotation', write_file = 'outfile' 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial9') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'github-annotation', '--disable-progress-bar', '--write-output', ...)] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_multiple_files[outfile-github-annotation-native] _ 1407s 1407s serialize = 'github-annotation-native', write_file = 'outfile' 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial10') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'github-annotation-native', '--disable-progress-bar', '--write-output', ...)] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________ test__cli__command_lint_serialize_multiple_files[outfile-none] ________ 1407s 1407s serialize = 'none', write_file = 'outfile' 1407s tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test__cli__command_lint_serial11') 1407s 1407s @pytest.mark.parametrize( 1407s "serialize", 1407s ["human", "yaml", "json", "github-annotation", "github-annotation-native", "none"], 1407s ) 1407s @pytest.mark.parametrize("write_file", [None, "outfile"]) 1407s def test__cli__command_lint_serialize_multiple_files(serialize, write_file, tmp_path): 1407s """Test the output formats for multiple files. 1407s 1407s This tests runs both stdout checking and file checking. 1407s """ 1407s fpath1 = "test/fixtures/linter/indentation_errors.sql" 1407s fpath2 = "test/fixtures/linter/multiple_sql_errors.sql" 1407s 1407s cmd_args = ( 1407s fpath1, 1407s fpath2, 1407s "--format", 1407s serialize, 1407s "--disable-progress-bar", 1407s ) 1407s 1407s if write_file: 1407s ext = { 1407s "human": ".txt", 1407s "yaml": ".yaml", 1407s } 1407s target_file = os.path.join(tmp_path, write_file + ext.get(serialize, ".json")) 1407s cmd_args += ("--write-output", target_file) 1407s 1407s # note the file is in here twice. two files = two payloads. 1407s > result = invoke_assert_code( 1407s args=[lint, cmd_args], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1644: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/indentation_errors.sql', 'test/fixtures/linter/multiple_sql_errors.sql', '--format', 'none', '--disable-progress-bar', '--write-output', ...)] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _____________ test__cli__command_lint_serialize_github_annotation ______________ 1407s 1407s def test__cli__command_lint_serialize_github_annotation(): 1407s """Test format of github-annotation output.""" 1407s fpath = "test/fixtures/linter/identifier_capitalisation.sql" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s fpath, 1407s "--format", 1407s "github-annotation", 1407s "--annotation-level", 1407s "warning", 1407s "--disable-progress-bar", 1407s ), 1407s ], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1690: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/identifier_capitalisation.sql', '--format', 'github-annotation', '--annotation-level', 'warning', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_github_annotation_native[test/fixtures/linter/identifier_capitalisation.sql-::group::{filename}\n::error title=SQLFluff,file={filename},line=3,col=5,endLine=3,endColumn=8::RF02: Unqualified reference 'foo' found in select with more than one referenced table/view. [references.qualification]\n::error title=SQLFluff,file={filename},line=4,col=1,endLine=4,endColumn=5::LT02: Expected indent of 8 spaces. [layout.indent]\n::error title=SQLFluff,file={filename},line=4,col=5,endLine=4,endColumn=8::AL02: Implicit/explicit aliasing of columns. [aliasing.column]\n::error title=SQLFluff,file={filename},line=4,col=5,endLine=4,endColumn=8::CP02: Unquoted identifiers must be consistently lower case. [capitalisation.identifiers]\n::notice title=SQLFluff,file={filename},line=5,col=1,endLine=5,endColumn=5::CP01: Keywords must be consistently lower case. [capitalisation.keywords]\n::error title=SQLFluff,file={filename},line=5,col=12,endLine=5,endColumn=16::CP02: Unquoted identifiers must be consistently lower case. [capitalisation.identifiers]\n::error title=SQLFluff,file={filename},line=5,col=18,endLine=5,endColumn=22::CP02: Unquoted identifiers must be consistently lower case. [capitalisation.identifiers]\n::endgroup::\n] _ 1407s 1407s filename = 'test/fixtures/linter/identifier_capitalisation.sql' 1407s expected_output = '::group::{filename}\n::error title=SQLFluff,file={filename},line=3,col=5,endLine=3,endColumn=8::RF02: Unqualified ref...endColumn=22::CP02: Unquoted identifiers must be consistently lower case. [capitalisation.identifiers]\n::endgroup::\n' 1407s 1407s @pytest.mark.parametrize( 1407s "filename,expected_output", 1407s [ 1407s ( 1407s "test/fixtures/linter/identifier_capitalisation.sql", 1407s ( 1407s "::group::{filename}\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=3,col=5,endLine=3,endColumn=8::" 1407s "RF02: Unqualified reference 'foo' found in select with more than one " 1407s "referenced table/view. [references.qualification]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=4,col=1,endLine=4,endColumn=5::" 1407s "LT02: Expected indent of 8 spaces. [layout.indent]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=4,col=5,endLine=4,endColumn=8::" 1407s "AL02: Implicit/explicit aliasing of columns. [aliasing.column]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=4,col=5,endLine=4,endColumn=8::" 1407s "CP02: Unquoted identifiers must be consistently lower case. " 1407s "[capitalisation.identifiers]\n" 1407s # Warnings should always come through as notices. 1407s "::notice title=SQLFluff,file={filename}," 1407s "line=5,col=1,endLine=5,endColumn=5::" 1407s "CP01: Keywords must be consistently lower case. " 1407s "[capitalisation.keywords]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=5,col=12,endLine=5,endColumn=16::" 1407s "CP02: Unquoted identifiers must be consistently lower case. " 1407s "[capitalisation.identifiers]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=5,col=18,endLine=5,endColumn=22::" 1407s "CP02: Unquoted identifiers must be consistently lower case. " 1407s "[capitalisation.identifiers]\n" 1407s "::endgroup::\n" 1407s # SQLFluff produces trailing newline 1407s ), 1407s ), 1407s ( 1407s "test/fixtures/linter/jinja_spacing.sql", 1407s ( 1407s "::group::{filename}\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=3,col=15,endLine=3,endColumn=22::JJ01: " 1407s "Jinja tags should have a single whitespace on either " 1407s # NOTE: Double escaping, because we're going to pass this through a 1407s # .format() method. 1407s "side: {{{{foo}}}} " 1407s "[jinja.padding]\n" 1407s "::endgroup::\n" 1407s ), 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_github_annotation_native( 1407s filename, expected_output 1407s ): 1407s """Test format of github-annotation output.""" 1407s # Normalise paths to control for OS variance 1407s fpath_normalised = os.path.normpath(filename) 1407s 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s filename, 1407s "--format", 1407s "github-annotation-native", 1407s "--annotation-level", 1407s "error", 1407s "--disable-progress-bar", 1407s ), 1407s ], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1863: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/identifier_capitalisation.sql', '--format', 'github-annotation-native', '--annotation-level', 'error', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_github_annotation_native[test/fixtures/linter/jinja_spacing.sql-::group::{filename}\n::error title=SQLFluff,file={filename},line=3,col=15,endLine=3,endColumn=22::JJ01: Jinja tags should have a single whitespace on either side: {{{{foo}}}} [jinja.padding]\n::endgroup::\n] _ 1407s 1407s filename = 'test/fixtures/linter/jinja_spacing.sql' 1407s expected_output = '::group::{filename}\n::error title=SQLFluff,file={filename},line=3,col=15,endLine=3,endColumn=22::JJ01: Jinja tags should have a single whitespace on either side: {{{{foo}}}} [jinja.padding]\n::endgroup::\n' 1407s 1407s @pytest.mark.parametrize( 1407s "filename,expected_output", 1407s [ 1407s ( 1407s "test/fixtures/linter/identifier_capitalisation.sql", 1407s ( 1407s "::group::{filename}\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=3,col=5,endLine=3,endColumn=8::" 1407s "RF02: Unqualified reference 'foo' found in select with more than one " 1407s "referenced table/view. [references.qualification]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=4,col=1,endLine=4,endColumn=5::" 1407s "LT02: Expected indent of 8 spaces. [layout.indent]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=4,col=5,endLine=4,endColumn=8::" 1407s "AL02: Implicit/explicit aliasing of columns. [aliasing.column]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=4,col=5,endLine=4,endColumn=8::" 1407s "CP02: Unquoted identifiers must be consistently lower case. " 1407s "[capitalisation.identifiers]\n" 1407s # Warnings should always come through as notices. 1407s "::notice title=SQLFluff,file={filename}," 1407s "line=5,col=1,endLine=5,endColumn=5::" 1407s "CP01: Keywords must be consistently lower case. " 1407s "[capitalisation.keywords]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=5,col=12,endLine=5,endColumn=16::" 1407s "CP02: Unquoted identifiers must be consistently lower case. " 1407s "[capitalisation.identifiers]\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=5,col=18,endLine=5,endColumn=22::" 1407s "CP02: Unquoted identifiers must be consistently lower case. " 1407s "[capitalisation.identifiers]\n" 1407s "::endgroup::\n" 1407s # SQLFluff produces trailing newline 1407s ), 1407s ), 1407s ( 1407s "test/fixtures/linter/jinja_spacing.sql", 1407s ( 1407s "::group::{filename}\n" 1407s "::error title=SQLFluff,file={filename}," 1407s "line=3,col=15,endLine=3,endColumn=22::JJ01: " 1407s "Jinja tags should have a single whitespace on either " 1407s # NOTE: Double escaping, because we're going to pass this through a 1407s # .format() method. 1407s "side: {{{{foo}}}} " 1407s "[jinja.padding]\n" 1407s "::endgroup::\n" 1407s ), 1407s ), 1407s ], 1407s ) 1407s def test__cli__command_lint_serialize_github_annotation_native( 1407s filename, expected_output 1407s ): 1407s """Test format of github-annotation output.""" 1407s # Normalise paths to control for OS variance 1407s fpath_normalised = os.path.normpath(filename) 1407s 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s filename, 1407s "--format", 1407s "github-annotation-native", 1407s "--annotation-level", 1407s "error", 1407s "--disable-progress-bar", 1407s ), 1407s ], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1863: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/jinja_spacing.sql', '--format', 'github-annotation-native', '--annotation-level', 'error', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_annotation_level_error_failure_equivalent[github-annotation] _ 1407s 1407s serialize = 'github-annotation' 1407s 1407s @pytest.mark.parametrize("serialize", ["github-annotation", "github-annotation-native"]) 1407s def test__cli__command_lint_serialize_annotation_level_error_failure_equivalent( 1407s serialize, 1407s ): 1407s """Test format of github-annotation output.""" 1407s fpath = "test/fixtures/linter/identifier_capitalisation.sql" 1407s > result_error = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s fpath, 1407s "--format", 1407s serialize, 1407s "--annotation-level", 1407s "error", 1407s "--disable-progress-bar", 1407s ), 1407s ], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1886: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/identifier_capitalisation.sql', '--format', 'github-annotation', '--annotation-level', 'error', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _ test__cli__command_lint_serialize_annotation_level_error_failure_equivalent[github-annotation-native] _ 1407s 1407s serialize = 'github-annotation-native' 1407s 1407s @pytest.mark.parametrize("serialize", ["github-annotation", "github-annotation-native"]) 1407s def test__cli__command_lint_serialize_annotation_level_error_failure_equivalent( 1407s serialize, 1407s ): 1407s """Test format of github-annotation output.""" 1407s fpath = "test/fixtures/linter/identifier_capitalisation.sql" 1407s > result_error = invoke_assert_code( 1407s args=[ 1407s lint, 1407s ( 1407s fpath, 1407s "--format", 1407s serialize, 1407s "--annotation-level", 1407s "error", 1407s "--disable-progress-bar", 1407s ), 1407s ], 1407s ret_code=1, 1407s ) 1407s 1407s test/cli/commands_test.py:1886: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ('test/fixtures/linter/identifier_capitalisation.sql', '--format', 'github-annotation-native', '--annotation-level', 'error', '--disable-progress-bar')] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __________________________ test_encoding[utf-8-ascii] __________________________ 1407s 1407s encoding_in = 'utf-8', encoding_out = 'ascii' 1407s 1407s @pytest.mark.parametrize( 1407s "encoding_in,encoding_out", 1407s [ 1407s ("utf-8", "ascii"), # chardet will detect ascii as a subset of utf-8 1407s ("utf-8-sig", "UTF-8-SIG"), 1407s ("utf-32", "UTF-32"), 1407s ], 1407s ) 1407s def test_encoding(encoding_in, encoding_out): 1407s """Check the encoding of the test file remains the same after fix is applied.""" 1407s with open("test/fixtures/linter/indentation_errors.sql", "r") as testfile: 1407s > generic_roundtrip_test( 1407s testfile, 1407s "LT01", 1407s input_file_encoding=encoding_in, 1407s output_file_encoding=encoding_out, 1407s ) 1407s 1407s test/cli/commands_test.py:1938: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s test/cli/commands_test.py:928: in generic_roundtrip_test 1407s invoke_assert_code( 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--dialect=ansi', '--rules', 'LT01', '/tmp/tmp9tanpa5p/testing.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ______________________ test_encoding[utf-8-sig-UTF-8-SIG] ______________________ 1407s 1407s encoding_in = 'utf-8-sig', encoding_out = 'UTF-8-SIG' 1407s 1407s @pytest.mark.parametrize( 1407s "encoding_in,encoding_out", 1407s [ 1407s ("utf-8", "ascii"), # chardet will detect ascii as a subset of utf-8 1407s ("utf-8-sig", "UTF-8-SIG"), 1407s ("utf-32", "UTF-32"), 1407s ], 1407s ) 1407s def test_encoding(encoding_in, encoding_out): 1407s """Check the encoding of the test file remains the same after fix is applied.""" 1407s with open("test/fixtures/linter/indentation_errors.sql", "r") as testfile: 1407s > generic_roundtrip_test( 1407s testfile, 1407s "LT01", 1407s input_file_encoding=encoding_in, 1407s output_file_encoding=encoding_out, 1407s ) 1407s 1407s test/cli/commands_test.py:1938: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s test/cli/commands_test.py:928: in generic_roundtrip_test 1407s invoke_assert_code( 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--dialect=ansi', '--rules', 'LT01', '/tmp/tmp9s1s36id/testing.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________________________ test_encoding[utf-32-UTF-32] _________________________ 1407s 1407s encoding_in = 'utf-32', encoding_out = 'UTF-32' 1407s 1407s @pytest.mark.parametrize( 1407s "encoding_in,encoding_out", 1407s [ 1407s ("utf-8", "ascii"), # chardet will detect ascii as a subset of utf-8 1407s ("utf-8-sig", "UTF-8-SIG"), 1407s ("utf-32", "UTF-32"), 1407s ], 1407s ) 1407s def test_encoding(encoding_in, encoding_out): 1407s """Check the encoding of the test file remains the same after fix is applied.""" 1407s with open("test/fixtures/linter/indentation_errors.sql", "r") as testfile: 1407s > generic_roundtrip_test( 1407s testfile, 1407s "LT01", 1407s input_file_encoding=encoding_in, 1407s output_file_encoding=encoding_out, 1407s ) 1407s 1407s test/cli/commands_test.py:1938: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s test/cli/commands_test.py:928: in generic_roundtrip_test 1407s invoke_assert_code( 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--dialect=ansi', '--rules', 'LT01', '/tmp/tmpfhwhvuea/testing.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________________ test_cli_encoding[utf-8-command-line-False] __________________ 1407s 1407s encoding = 'utf-8', method = 'command-line', expect_success = False 1407s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_cli_encoding_utf_8_comman0') 1407s 1407s @pytest.mark.parametrize( 1407s "encoding,method,expect_success", 1407s [ 1407s ("utf-8", "command-line", False), 1407s ("utf-8-SIG", "command-line", True), 1407s ("utf-8", "config-file", False), 1407s ("utf-8-SIG", "config-file", True), 1407s ], 1407s ) 1407s def test_cli_encoding(encoding, method, expect_success, tmpdir): 1407s """Try loading a utf-8-SIG encoded file using the correct encoding via the cli.""" 1407s sql_path = "test/fixtures/cli/encoding_test.sql" 1407s if method == "command-line": 1407s options = [sql_path, "--encoding", encoding] 1407s else: 1407s assert method == "config-file" 1407s with open(str(tmpdir / ".sqlfluff"), "w") as f: 1407s print(f"[sqlfluff]\ndialect=ansi\nencoding = {encoding}", file=f) 1407s shutil.copy(sql_path, tmpdir) 1407s options = [str(tmpdir / "encoding_test.sql")] 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s lint, 1407s options, 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:1966: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['test/fixtures/cli/encoding_test.sql', '--encoding', 'utf-8']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________________ test_cli_encoding[utf-8-SIG-command-line-True] ________________ 1407s 1407s encoding = 'utf-8-SIG', method = 'command-line', expect_success = True 1407s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_cli_encoding_utf_8_SIG_co0') 1407s 1407s @pytest.mark.parametrize( 1407s "encoding,method,expect_success", 1407s [ 1407s ("utf-8", "command-line", False), 1407s ("utf-8-SIG", "command-line", True), 1407s ("utf-8", "config-file", False), 1407s ("utf-8-SIG", "config-file", True), 1407s ], 1407s ) 1407s def test_cli_encoding(encoding, method, expect_success, tmpdir): 1407s """Try loading a utf-8-SIG encoded file using the correct encoding via the cli.""" 1407s sql_path = "test/fixtures/cli/encoding_test.sql" 1407s if method == "command-line": 1407s options = [sql_path, "--encoding", encoding] 1407s else: 1407s assert method == "config-file" 1407s with open(str(tmpdir / ".sqlfluff"), "w") as f: 1407s print(f"[sqlfluff]\ndialect=ansi\nencoding = {encoding}", file=f) 1407s shutil.copy(sql_path, tmpdir) 1407s options = [str(tmpdir / "encoding_test.sql")] 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s lint, 1407s options, 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:1966: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['test/fixtures/cli/encoding_test.sql', '--encoding', 'utf-8-SIG']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __________________ test_cli_encoding[utf-8-config-file-False] __________________ 1407s 1407s encoding = 'utf-8', method = 'config-file', expect_success = False 1407s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_cli_encoding_utf_8_config0') 1407s 1407s @pytest.mark.parametrize( 1407s "encoding,method,expect_success", 1407s [ 1407s ("utf-8", "command-line", False), 1407s ("utf-8-SIG", "command-line", True), 1407s ("utf-8", "config-file", False), 1407s ("utf-8-SIG", "config-file", True), 1407s ], 1407s ) 1407s def test_cli_encoding(encoding, method, expect_success, tmpdir): 1407s """Try loading a utf-8-SIG encoded file using the correct encoding via the cli.""" 1407s sql_path = "test/fixtures/cli/encoding_test.sql" 1407s if method == "command-line": 1407s options = [sql_path, "--encoding", encoding] 1407s else: 1407s assert method == "config-file" 1407s with open(str(tmpdir / ".sqlfluff"), "w") as f: 1407s print(f"[sqlfluff]\ndialect=ansi\nencoding = {encoding}", file=f) 1407s shutil.copy(sql_path, tmpdir) 1407s options = [str(tmpdir / "encoding_test.sql")] 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s lint, 1407s options, 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:1966: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['/tmp/pytest-of-ubuntu/pytest-0/test_cli_encoding_utf_8_config0/encoding_test.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________________ test_cli_encoding[utf-8-SIG-config-file-True] _________________ 1407s 1407s encoding = 'utf-8-SIG', method = 'config-file', expect_success = True 1407s tmpdir = local('/tmp/pytest-of-ubuntu/pytest-0/test_cli_encoding_utf_8_SIG_co1') 1407s 1407s @pytest.mark.parametrize( 1407s "encoding,method,expect_success", 1407s [ 1407s ("utf-8", "command-line", False), 1407s ("utf-8-SIG", "command-line", True), 1407s ("utf-8", "config-file", False), 1407s ("utf-8-SIG", "config-file", True), 1407s ], 1407s ) 1407s def test_cli_encoding(encoding, method, expect_success, tmpdir): 1407s """Try loading a utf-8-SIG encoded file using the correct encoding via the cli.""" 1407s sql_path = "test/fixtures/cli/encoding_test.sql" 1407s if method == "command-line": 1407s options = [sql_path, "--encoding", encoding] 1407s else: 1407s assert method == "config-file" 1407s with open(str(tmpdir / ".sqlfluff"), "w") as f: 1407s print(f"[sqlfluff]\ndialect=ansi\nencoding = {encoding}", file=f) 1407s shutil.copy(sql_path, tmpdir) 1407s options = [str(tmpdir / "encoding_test.sql")] 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s lint, 1407s options, 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:1966: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['/tmp/pytest-of-ubuntu/pytest-0/test_cli_encoding_utf_8_SIG_co1/encoding_test.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________________________ test_cli_no_disable_noqa_flag _________________________ 1407s 1407s def test_cli_no_disable_noqa_flag(): 1407s """Test that unset --disable-noqa flag respects inline noqa comments.""" 1407s > invoke_assert_code( 1407s ret_code=0, 1407s args=[ 1407s lint, 1407s ["test/fixtures/cli/disable_noqa_test.sql"], 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:1984: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ['test/fixtures/cli/disable_noqa_test.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __________________________ test_cli_disable_noqa_flag __________________________ 1407s 1407s def test_cli_disable_noqa_flag(): 1407s """Test that --disable-noqa flag ignores inline noqa comments.""" 1407s > invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s lint, 1407s [ 1407s "test/fixtures/cli/disable_noqa_test.sql", 1407s "--disable-noqa", 1407s ], 1407s ], 1407s # Linting error is raised even though it is inline ignored. 1407s assert_output_contains=r"L: 6 | P: 11 | CP01 |", 1407s ) 1407s 1407s test/cli/commands_test.py:1995: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['test/fixtures/cli/disable_noqa_test.sql', '--disable-noqa']] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = 'L: 6 | P: 11 | CP01 |', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ______________________ test_cli_disable_noqa_except_flag _______________________ 1407s 1407s def test_cli_disable_noqa_except_flag(): 1407s """Test that --disable-noqa-except flag ignores inline noqa comments.""" 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s lint, 1407s [ 1407s "test/fixtures/cli/disable_noqa_test.sql", 1407s "--disable-noqa-except", 1407s "CP01", 1407s ], 1407s ], 1407s # Linting error is raised even though it is inline ignored. 1407s assert_output_contains=r"L: 8 | P: 5 | CP03 |", 1407s ) 1407s 1407s test/cli/commands_test.py:2011: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['test/fixtures/cli/disable_noqa_test.sql', '--disable-noqa-except', 'CP01']] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = 'L: 8 | P: 5 | CP03 |', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _________________ test_cli_disable_noqa_except_non_rules_flag __________________ 1407s 1407s def test_cli_disable_noqa_except_non_rules_flag(): 1407s """Test that --disable-noqa-except flag ignores all inline noqa comments.""" 1407s > invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s lint, 1407s [ 1407s "test/fixtures/cli/disable_noqa_test.sql", 1407s "--disable-noqa-except", 1407s "None", 1407s ], 1407s ], 1407s # Linting error is raised even though it is inline ignored. 1407s assert_output_contains=r"L: 6 | P: 11 | CP01 |", 1407s ) 1407s 1407s test/cli/commands_test.py:2029: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['test/fixtures/cli/disable_noqa_test.sql', '--disable-noqa-except', 'None']] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = 'L: 6 | P: 11 | CP01 |', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________________________ test_cli_warn_unused_noqa_flag ________________________ 1407s 1407s def test_cli_warn_unused_noqa_flag(): 1407s """Test that --warn-unused-ignores flag works.""" 1407s > invoke_assert_code( 1407s # Return value should still be success. 1407s ret_code=0, 1407s args=[ 1407s lint, 1407s [ 1407s "test/fixtures/cli/disable_noqa_test.sql", 1407s "--warn-unused-ignores", 1407s ], 1407s ], 1407s # Warning shown. 1407s assert_output_contains=( 1407s r"L: 5 | P: 18 | NOQA | WARNING: Unused noqa: 'noqa: CP01'" 1407s ), 1407s ) 1407s 1407s test/cli/commands_test.py:2046: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ['test/fixtures/cli/disable_noqa_test.sql', '--warn-unused-ignores']] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = "L: 5 | P: 18 | NOQA | WARNING: Unused noqa: 'noqa: CP01'" 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _____________ TestProgressBars.test_cli_lint_disabled_progress_bar _____________ 1407s 1407s self = 1407s mock_disable_progress_bar = 1407s 1407s def test_cli_lint_disabled_progress_bar( 1407s self, mock_disable_progress_bar: MagicMock 1407s ) -> None: 1407s """When progress bar is disabled, nothing should be printed into output.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s [ 1407s "--disable-progress-bar", 1407s "test/fixtures/linter/passing.sql", 1407s ], 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:2095: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ['--disable-progress-bar', 'test/fixtures/linter/passing.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _____________ TestProgressBars.test_cli_lint_enabled_progress_bar ______________ 1407s 1407s self = 1407s mock_disable_progress_bar = 1407s 1407s def test_cli_lint_enabled_progress_bar( 1407s self, mock_disable_progress_bar: MagicMock 1407s ) -> None: 1407s """When progress bar is enabled, there should be some tracks in output.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s [ 1407s "test/fixtures/linter/passing.sql", 1407s ], 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:2114: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0, args = [, ['test/fixtures/linter/passing.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ______ TestProgressBars.test_cli_lint_enabled_progress_bar_multiple_paths ______ 1407s 1407s self = 1407s mock_disable_progress_bar = 1407s 1407s def test_cli_lint_enabled_progress_bar_multiple_paths( 1407s self, mock_disable_progress_bar: MagicMock 1407s ) -> None: 1407s """When progress bar is enabled, there should be some tracks in output.""" 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s lint, 1407s [ 1407s "test/fixtures/linter/passing.sql", 1407s "test/fixtures/linter/indentation_errors.sql", 1407s ], 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:2132: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['test/fixtures/linter/passing.sql', 'test/fixtures/linter/indentation_errors.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ______ TestProgressBars.test_cli_lint_enabled_progress_bar_multiple_files ______ 1407s 1407s self = 1407s mock_disable_progress_bar = 1407s 1407s def test_cli_lint_enabled_progress_bar_multiple_files( 1407s self, mock_disable_progress_bar: MagicMock 1407s ) -> None: 1407s """When progress bar is enabled, there should be some tracks in output.""" 1407s > result = invoke_assert_code( 1407s args=[ 1407s lint, 1407s [ 1407s "test/fixtures/linter/multiple_files", 1407s ], 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:2156: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0, args = [, ['test/fixtures/linter/multiple_files']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ________________ test__cli__fix_multiple_errors_no_show_errors _________________ 1407s 1407s def test__cli__fix_multiple_errors_no_show_errors(): 1407s """Test the fix output.""" 1407s > invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s fix, 1407s [ 1407s "--check", # Run in check mode to get the confirmation. 1407s "--disable-progress-bar", 1407s "test/fixtures/linter/multiple_sql_errors.sql", 1407s ], 1407s ], 1407s assert_output_contains=multiple_expected_output, 1407s ) 1407s 1407s test/cli/commands_test.py:2208: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--check', '--disable-progress-bar', 'test/fixtures/linter/multiple_sql_errors.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = "==== finding fixable violations ====\n== [test/fixtures/linter/multiple_sql_errors.sql] FAIL\nL: 12 | P: 1 | LT02 ... fix these? [Y/n] ...\nInvalid input, please enter 'Y' or 'N'\nAborting...\n [4 unfixable linting violations found]\n" 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __________________ test__cli__fix_multiple_errors_quiet_force __________________ 1407s 1407s def test__cli__fix_multiple_errors_quiet_force(): 1407s """Test the fix --quiet option with --force.""" 1407s > invoke_assert_code( 1407s ret_code=0, 1407s args=[ 1407s fix, 1407s [ 1407s "--disable-progress-bar", 1407s "test/fixtures/linter/multiple_sql_errors.sql", 1407s "--quiet", 1407s "-x", 1407s "_fix", 1407s ], 1407s ], 1407s assert_output_contains=( 1407s """== [test/fixtures/linter/multiple_sql_errors.sql] FIXED 1407s 2 fixable linting violations found""" 1407s ), 1407s ) 1407s 1407s test/cli/commands_test.py:2224: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ['--disable-progress-bar', 'test/fixtures/linter/multiple_sql_errors.sql', '--quiet', '-x', '_fix']] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = '== [test/fixtures/linter/multiple_sql_errors.sql] FIXED\n2 fixable linting violations found' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __________________ test__cli__fix_multiple_errors_quiet_check __________________ 1407s 1407s def test__cli__fix_multiple_errors_quiet_check(): 1407s """Test the fix --quiet option without --force.""" 1407s > invoke_assert_code( 1407s ret_code=0, 1407s args=[ 1407s fix, 1407s [ 1407s "--disable-progress-bar", 1407s "test/fixtures/linter/multiple_sql_errors.sql", 1407s "--check", # Run in check mode to get the confirmation. 1407s "--quiet", 1407s "-x", 1407s "_fix", 1407s ], 1407s # Test with the confirmation step. 1407s "y", 1407s ], 1407s assert_output_contains=( 1407s """2 fixable linting violations found 1407s Are you sure you wish to attempt to fix these? [Y/n] ... 1407s == [test/fixtures/linter/multiple_sql_errors.sql] FIXED 1407s All Finished""" 1407s ), 1407s ) 1407s 1407s test/cli/commands_test.py:2245: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ['--disable-progress-bar', 'test/fixtures/linter/multiple_sql_errors.sql', '--check', '--quiet', '-x', '_fix'], 'y'] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = '2 fixable linting violations found\nAre you sure you wish to attempt to fix these? [Y/n] ...\n== [test/fixtures/linter/multiple_sql_errors.sql] FIXED\nAll Finished' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __________________ test__cli__fix_multiple_errors_show_errors __________________ 1407s 1407s def test__cli__fix_multiple_errors_show_errors(): 1407s """Test the fix --show-lint-violations option.""" 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s fix, 1407s [ 1407s "--disable-progress-bar", 1407s "--show-lint-violations", 1407s "test/fixtures/linter/multiple_sql_errors.sql", 1407s "--check", # Run in check mode to get the confirmation. 1407s ], 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:2271: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--disable-progress-bar', '--show-lint-violations', 'test/fixtures/linter/multiple_sql_errors.sql', '--check']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _______________________ test__cli__fix_show_parse_errors _______________________ 1407s 1407s def test__cli__fix_show_parse_errors(): 1407s """Test the fix --show-lint-violations option with parser error.""" 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s fix, 1407s [ 1407s "--show-lint-violations", 1407s "test/fixtures/linter/parse_lex_error.sql", 1407s ], 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:2309: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--show-lint-violations', 'test/fixtures/linter/parse_lex_error.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s __________ test__cli__multiple_files__fix_multiple_errors_show_errors __________ 1407s 1407s def test__cli__multiple_files__fix_multiple_errors_show_errors(): 1407s """Basic check of lint ensures with multiple files, filenames are listed.""" 1407s sql_path = "test/fixtures/linter/multiple_sql_errors.sql" 1407s indent_path = "test/fixtures/linter/indentation_errors.sql" 1407s > result = invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s fix, 1407s [ 1407s "--disable-progress-bar", 1407s "--check", # Run in check mode to get the confirmation. 1407s "--show-lint-violations", 1407s sql_path, 1407s indent_path, 1407s ], 1407s ], 1407s ) 1407s 1407s test/cli/commands_test.py:2349: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1 1407s args = [, ['--disable-progress-bar', '--check', '--show-lint-violations', 'test/fixtures/linter/multiple_sql_errors.sql', 'test/fixtures/linter/indentation_errors.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True, assert_output_contains = '' 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ____________________________ test__cli__render_fail ____________________________ 1407s 1407s def test__cli__render_fail(): 1407s """Basic how render fails.""" 1407s > invoke_assert_code( 1407s ret_code=1, 1407s args=[ 1407s render, 1407s [ 1407s "test/fixtures/cli/fail_many.sql", 1407s ], 1407s ], 1407s assert_output_contains=( 1407s "L: 3 | P: 8 | TMP | Undefined jinja template " "variable: 'something'" 1407s ), 1407s ) 1407s 1407s test/cli/commands_test.py:2379: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 1, args = [, ['test/fixtures/cli/fail_many.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = "L: 3 | P: 8 | TMP | Undefined jinja template variable: 'something'" 1407s raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s ____________________________ test__cli__render_pass ____________________________ 1407s 1407s def test__cli__render_pass(): 1407s """Basic how render works.""" 1407s > invoke_assert_code( 1407s ret_code=0, 1407s args=[ 1407s render, 1407s [ 1407s "test/fixtures/templater/jinja_a/jinja.sql", 1407s ], 1407s ], 1407s assert_output_contains="SELECT 56 FROM sch1.tbl2", 1407s ) 1407s 1407s test/cli/commands_test.py:2395: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s ret_code = 0 1407s args = [, ['test/fixtures/templater/jinja_a/jinja.sql']] 1407s kwargs = {}, cli_input = None, mix_stderr = True 1407s assert_output_contains = 'SELECT 56 FROM sch1.tbl2', raise_exceptions = True 1407s 1407s def invoke_assert_code( 1407s ret_code: int = 0, 1407s args: Optional[List[Any]] = None, 1407s kwargs: Optional[Dict[str, Any]] = None, 1407s cli_input: Optional[str] = None, 1407s mix_stderr: bool = True, 1407s assert_output_contains: str = "", 1407s raise_exceptions: bool = True, 1407s ) -> Result: 1407s """Invoke a command and check return code.""" 1407s args = args or [] 1407s kwargs = kwargs or {} 1407s if cli_input: 1407s kwargs["input"] = cli_input 1407s > runner = CliRunner(mix_stderr=mix_stderr) 1407s E TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/utils/testing/cli.py:22: TypeError 1407s _______ test_diff_quality_plugin[sql_paths0-expected_violations_lines0] ________ 1407s 1407s sql_paths = ['linter/indentation_errors.sql'] 1407s expected_violations_lines = [2, 3, 4, 5, 6] 1407s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa053f5c0> 1407s 1407s @pytest.mark.parametrize( 1407s "sql_paths,expected_violations_lines", 1407s [ 1407s (("linter/indentation_errors.sql",), list(range(2, 7))), 1407s (("linter/parse_error.sql",), {1}), 1407s # NB: This version of the file is in a directory configured 1407s # to ignore parsing errors. 1407s (("linter/diffquality/parse_error.sql",), []), 1407s (tuple(), []), 1407s ], 1407s ) 1407s def test_diff_quality_plugin(sql_paths, expected_violations_lines, monkeypatch): 1407s """Test the plugin at least finds errors on the expected lines.""" 1407s 1407s def execute(command, exit_codes): 1407s printable_command_parts = [ 1407s c.decode(sys.getfilesystemencoding()) if isinstance(c, bytes) else c 1407s for c in command 1407s ] 1407s 1407s result = invoke_assert_code( 1407s ret_code=1 if expected_violations_lines else 0, 1407s args=[ 1407s lint, 1407s printable_command_parts[2:], 1407s ], 1407s ) 1407s return result.output, "" 1407s 1407s # Mock the execute function -- this is an attempt to prevent the CircleCI 1407s # coverage check from hanging. (We've seen issues in the past where using 1407s # subprocesses caused things to occasionally hang.) 1407s monkeypatch.setattr(diff_quality_plugin, "execute", execute) 1407s monkeypatch.chdir("test/fixtures/") 1407s violation_reporter = diff_quality_plugin.diff_cover_report_quality( 1407s options="--processes=1" 1407s ) 1407s assert len(sql_paths) in (0, 1) 1407s sql_paths = [str(Path(sql_path)) for sql_path in sql_paths] 1407s 1407s > violations_dict = violation_reporter.violations_batch(sql_paths) 1407s 1407s /tmp/autopkgtest.gvzmUI/autopkgtest_tmp/test/diff_quality_plugin_test.py:53: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s self = 1407s src_paths = ['linter/indentation_errors.sql'] 1407s 1407s def violations_batch(self, src_paths): 1407s """Return a dictionary of Violations recorded in `src_paths`.""" 1407s # Check if SQLFluff is installed. 1407s if self.driver_tool_installed is None: 1407s self.driver_tool_installed = self.driver.installed() 1407s if not self.driver_tool_installed: # pragma: no cover 1407s > raise OSError(f"{self.driver.name} is not installed") 1407s E OSError: ['/usr/bin/python3.12', '-m', 'sqlfluff.cli.commands'] is not installed 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/diff_quality_plugin.py:61: OSError 1407s _______ test_diff_quality_plugin[sql_paths1-expected_violations_lines1] ________ 1407s 1407s sql_paths = ['linter/parse_error.sql'], expected_violations_lines = {1} 1407s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa053ec00> 1407s 1407s @pytest.mark.parametrize( 1407s "sql_paths,expected_violations_lines", 1407s [ 1407s (("linter/indentation_errors.sql",), list(range(2, 7))), 1407s (("linter/parse_error.sql",), {1}), 1407s # NB: This version of the file is in a directory configured 1407s # to ignore parsing errors. 1407s (("linter/diffquality/parse_error.sql",), []), 1407s (tuple(), []), 1407s ], 1407s ) 1407s def test_diff_quality_plugin(sql_paths, expected_violations_lines, monkeypatch): 1407s """Test the plugin at least finds errors on the expected lines.""" 1407s 1407s def execute(command, exit_codes): 1407s printable_command_parts = [ 1407s c.decode(sys.getfilesystemencoding()) if isinstance(c, bytes) else c 1407s for c in command 1407s ] 1407s 1407s result = invoke_assert_code( 1407s ret_code=1 if expected_violations_lines else 0, 1407s args=[ 1407s lint, 1407s printable_command_parts[2:], 1407s ], 1407s ) 1407s return result.output, "" 1407s 1407s # Mock the execute function -- this is an attempt to prevent the CircleCI 1407s # coverage check from hanging. (We've seen issues in the past where using 1407s # subprocesses caused things to occasionally hang.) 1407s monkeypatch.setattr(diff_quality_plugin, "execute", execute) 1407s monkeypatch.chdir("test/fixtures/") 1407s violation_reporter = diff_quality_plugin.diff_cover_report_quality( 1407s options="--processes=1" 1407s ) 1407s assert len(sql_paths) in (0, 1) 1407s sql_paths = [str(Path(sql_path)) for sql_path in sql_paths] 1407s 1407s > violations_dict = violation_reporter.violations_batch(sql_paths) 1407s 1407s /tmp/autopkgtest.gvzmUI/autopkgtest_tmp/test/diff_quality_plugin_test.py:53: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s self = 1407s src_paths = ['linter/parse_error.sql'] 1407s 1407s def violations_batch(self, src_paths): 1407s """Return a dictionary of Violations recorded in `src_paths`.""" 1407s # Check if SQLFluff is installed. 1407s if self.driver_tool_installed is None: 1407s self.driver_tool_installed = self.driver.installed() 1407s if not self.driver_tool_installed: # pragma: no cover 1407s > raise OSError(f"{self.driver.name} is not installed") 1407s E OSError: ['/usr/bin/python3.12', '-m', 'sqlfluff.cli.commands'] is not installed 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/diff_quality_plugin.py:61: OSError 1407s _______ test_diff_quality_plugin[sql_paths2-expected_violations_lines2] ________ 1407s 1407s sql_paths = ['linter/diffquality/parse_error.sql'] 1407s expected_violations_lines = [] 1407s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa053f140> 1407s 1407s @pytest.mark.parametrize( 1407s "sql_paths,expected_violations_lines", 1407s [ 1407s (("linter/indentation_errors.sql",), list(range(2, 7))), 1407s (("linter/parse_error.sql",), {1}), 1407s # NB: This version of the file is in a directory configured 1407s # to ignore parsing errors. 1407s (("linter/diffquality/parse_error.sql",), []), 1407s (tuple(), []), 1407s ], 1407s ) 1407s def test_diff_quality_plugin(sql_paths, expected_violations_lines, monkeypatch): 1407s """Test the plugin at least finds errors on the expected lines.""" 1407s 1407s def execute(command, exit_codes): 1407s printable_command_parts = [ 1407s c.decode(sys.getfilesystemencoding()) if isinstance(c, bytes) else c 1407s for c in command 1407s ] 1407s 1407s result = invoke_assert_code( 1407s ret_code=1 if expected_violations_lines else 0, 1407s args=[ 1407s lint, 1407s printable_command_parts[2:], 1407s ], 1407s ) 1407s return result.output, "" 1407s 1407s # Mock the execute function -- this is an attempt to prevent the CircleCI 1407s # coverage check from hanging. (We've seen issues in the past where using 1407s # subprocesses caused things to occasionally hang.) 1407s monkeypatch.setattr(diff_quality_plugin, "execute", execute) 1407s monkeypatch.chdir("test/fixtures/") 1407s violation_reporter = diff_quality_plugin.diff_cover_report_quality( 1407s options="--processes=1" 1407s ) 1407s assert len(sql_paths) in (0, 1) 1407s sql_paths = [str(Path(sql_path)) for sql_path in sql_paths] 1407s 1407s > violations_dict = violation_reporter.violations_batch(sql_paths) 1407s 1407s /tmp/autopkgtest.gvzmUI/autopkgtest_tmp/test/diff_quality_plugin_test.py:53: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s self = 1407s src_paths = ['linter/diffquality/parse_error.sql'] 1407s 1407s def violations_batch(self, src_paths): 1407s """Return a dictionary of Violations recorded in `src_paths`.""" 1407s # Check if SQLFluff is installed. 1407s if self.driver_tool_installed is None: 1407s self.driver_tool_installed = self.driver.installed() 1407s if not self.driver_tool_installed: # pragma: no cover 1407s > raise OSError(f"{self.driver.name} is not installed") 1407s E OSError: ['/usr/bin/python3.12', '-m', 'sqlfluff.cli.commands'] is not installed 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/diff_quality_plugin.py:61: OSError 1407s _______ test_diff_quality_plugin[sql_paths3-expected_violations_lines3] ________ 1407s 1407s sql_paths = [], expected_violations_lines = [] 1407s monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x3ffa84776b0> 1407s 1407s @pytest.mark.parametrize( 1407s "sql_paths,expected_violations_lines", 1407s [ 1407s (("linter/indentation_errors.sql",), list(range(2, 7))), 1407s (("linter/parse_error.sql",), {1}), 1407s # NB: This version of the file is in a directory configured 1407s # to ignore parsing errors. 1407s (("linter/diffquality/parse_error.sql",), []), 1407s (tuple(), []), 1407s ], 1407s ) 1407s def test_diff_quality_plugin(sql_paths, expected_violations_lines, monkeypatch): 1407s """Test the plugin at least finds errors on the expected lines.""" 1407s 1407s def execute(command, exit_codes): 1407s printable_command_parts = [ 1407s c.decode(sys.getfilesystemencoding()) if isinstance(c, bytes) else c 1407s for c in command 1407s ] 1407s 1407s result = invoke_assert_code( 1407s ret_code=1 if expected_violations_lines else 0, 1407s args=[ 1407s lint, 1407s printable_command_parts[2:], 1407s ], 1407s ) 1407s return result.output, "" 1407s 1407s # Mock the execute function -- this is an attempt to prevent the CircleCI 1407s # coverage check from hanging. (We've seen issues in the past where using 1407s # subprocesses caused things to occasionally hang.) 1407s monkeypatch.setattr(diff_quality_plugin, "execute", execute) 1407s monkeypatch.chdir("test/fixtures/") 1407s violation_reporter = diff_quality_plugin.diff_cover_report_quality( 1407s options="--processes=1" 1407s ) 1407s assert len(sql_paths) in (0, 1) 1407s sql_paths = [str(Path(sql_path)) for sql_path in sql_paths] 1407s 1407s > violations_dict = violation_reporter.violations_batch(sql_paths) 1407s 1407s /tmp/autopkgtest.gvzmUI/autopkgtest_tmp/test/diff_quality_plugin_test.py:53: 1407s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1407s 1407s self = 1407s src_paths = [] 1407s 1407s def violations_batch(self, src_paths): 1407s """Return a dictionary of Violations recorded in `src_paths`.""" 1407s # Check if SQLFluff is installed. 1407s if self.driver_tool_installed is None: 1407s self.driver_tool_installed = self.driver.installed() 1407s if not self.driver_tool_installed: # pragma: no cover 1407s > raise OSError(f"{self.driver.name} is not installed") 1407s E OSError: ['/usr/bin/python3.12', '-m', 'sqlfluff.cli.commands'] is not installed 1407s 1407s /usr/lib/python3/dist-packages/sqlfluff/diff_quality_plugin.py:61: OSError 1407s =========================== short test summary info ============================ 1407s FAILED test/cli/commands_test.py::test__cli__command_directed - TypeError: Cl... 1407s FAILED test/cli/commands_test.py::test__cli__command_dialect - TypeError: Cli... 1407s FAILED test/cli/commands_test.py::test__cli__command_no_dialect[command0] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_no_dialect[command1] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_no_dialect[command2] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_no_dialect[command3] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_no_dialect[command4] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_parse_error_dialect_explicit_warning 1407s FAILED test/cli/commands_test.py::test__cli__command_parse_error_dialect_implicit_warning 1407s FAILED test/cli/commands_test.py::test__cli__command_dialect_legacy - TypeErr... 1407s FAILED test/cli/commands_test.py::test__cli__command_extra_config_fail - Type... 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command0-test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql-0-[L: 5, P: 1] | join_clause:\n[L: 5, P: 1] | keyword: 'POSITIONAL'] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command1-test/fixtures/an_ansi_config_here.sql-1-Parsing errors found and dialect is set to 'ansi'.] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command2-test/fixtures/cli/stdin_filename/stdin_filename.sql-0-All Finished!] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command3-test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql-0-All Finished!] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command4-test/fixtures/an_ansi_config_here.sql-1-Parsing errors found and dialect is set to 'ansi'.] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command5-test/fixtures/cli/stdin_filename/stdin_filename.sql-0-SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command6-test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql-0-SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command7-test/fixtures/an_ansi_config_here.sql-1-[1 templating/parsing errors found]] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command8-test/fixtures/cli/stdin_filename/stdin_filename.sql-0-SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command9-test/fixtures/cli/stdin_filename/without_config/stdin_filename.sql-0-SELECT\n A.COL1,\n B.COL2\nFROM TABA AS A\nPOSITIONAL JOIN TABB AS B;\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_stdin_filename_config[command10-test/fixtures/an_ansi_config_here.sql-1-Unfixable violations detected.] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_stdin[command0] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_stdin[command1] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_stdin[command2] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_stdin[command3] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_empty_stdin - TypeE... 1407s FAILED test/cli/commands_test.py::test__cli__command_render_stdin - TypeError... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command0] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command1] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command2] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command3] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command4] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command5] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command6] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command7] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command8] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command9] - T... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command10] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command11] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command12] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command13] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command14] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command15] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command16] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command17] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command18] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command19] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command20] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command21] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command22] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command23] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command24] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command25] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command26] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command27] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command28] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse[command29] - ... 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command0-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command1-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command2-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command3-0] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command4-0] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command5-2] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command6-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command7-0] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command8-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command9-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command10-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command11-2] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command12-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_parse_with_retcode[command13-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_rules - TypeError: CliRu... 1407s FAILED test/cli/commands_test.py::test__cli__command_dialects - TypeError: Cl... 1407s FAILED test/cli/commands_test.py::test__cli__command__fix[LT01-test/fixtures/linter/indentation_errors.sql0] 1407s FAILED test/cli/commands_test.py::test__cli__command__fix[LT01-test/fixtures/linter/whitespace_errors.sql] 1407s FAILED test/cli/commands_test.py::test__cli__command__fix[LT01-test/fixtures/linter/indentation_errors.sql1] 1407s FAILED test/cli/commands_test.py::test__cli__command__fix[LT02-test/fixtures/linter/indentation_error_hard.sql] 1407s FAILED test/cli/commands_test.py::test_cli_fix_even_unparsable[command-line-False] 1407s FAILED test/cli/commands_test.py::test_cli_fix_even_unparsable[command-line-True] 1407s FAILED test/cli/commands_test.py::test_cli_fix_even_unparsable[config-file-False] 1407s FAILED test/cli/commands_test.py::test_cli_fix_even_unparsable[config-file-True] 1407s FAILED test/cli/commands_test.py::test__cli__command_fix_stdin[select * from t-LT02-select * from t] 1407s FAILED test/cli/commands_test.py::test__cli__command_fix_stdin[ select * from t-LT02-select * from t] 1407s FAILED test/cli/commands_test.py::test__cli__command_format_stdin[select * from t\n-select * from t\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_format_stdin[ select * FRoM t -select * from t\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_format_stdin[select\n count(*) over (\n order by a desc \n range between b row and '10 seconds' following -- noqa: PRS\n ) as c\nfrom d\n-select\n count(*) over (\n order by a desc \n range between b row and '10 seconds' following -- noqa: PRS\n ) as c\nfrom d\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_fix_stdin_logging_to_stderr 1407s FAILED test/cli/commands_test.py::test__cli__command_fix_stdin_safety - TypeE... 1407s FAILED test/cli/commands_test.py::test__cli__command_fix_stdin_error_exit_code[create TABLE {{ params.dsfsdfds }}.t (a int)-1--v-Fix aborted due to unparsable template variables.] 1407s FAILED test/cli/commands_test.py::test__cli__command_fix_stdin_error_exit_code[create TABLE a.t (a int)-0--] 1407s FAILED test/cli/commands_test.py::test__cli__command_fix_stdin_error_exit_code[create table a.t (a int)-0--] 1407s FAILED test/cli/commands_test.py::test__cli__command_fix_stdin_error_exit_code[select col from a join b using (c)-1--v-Unfixable violations detected.] 1407s FAILED test/cli/commands_test.py::test__cli__command__fix_check[LT01-test/fixtures/linter/indentation_errors.sql-y-0-0] 1407s FAILED test/cli/commands_test.py::test__cli__command__fix_check[LT01-test/fixtures/linter/indentation_errors.sql-n-1-1] 1407s FAILED test/cli/commands_test.py::test__cli__command_parse_serialize_from_stdin[None-yaml] 1407s FAILED test/cli/commands_test.py::test__cli__command_parse_serialize_from_stdin[None-json] 1407s FAILED test/cli/commands_test.py::test__cli__command_parse_serialize_from_stdin[outfile-yaml] 1407s FAILED test/cli/commands_test.py::test__cli__command_parse_serialize_from_stdin[outfile-json] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[select * from tbl-CP01-expected0-0-yaml] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[select * from tbl-CP01-expected0-0-json] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[select * from tbl-CP01-expected0-0-none] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[SElect * from tbl-CP01-expected1-1-yaml] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[SElect * from tbl-CP01-expected1-1-json] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[SElect * from tbl-CP01-expected1-1-none] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[SELECT {{1}}-JJ01-expected2-1-yaml] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[SELECT {{1}}-JJ01-expected2-1-json] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_from_stdin[SELECT {{1}}-JJ01-expected2-1-none] 1407s FAILED test/cli/commands_test.py::test__cli__command_fail_nice_not_found[command0] 1407s FAILED test/cli/commands_test.py::test__cli__command_fail_nice_not_found[command1] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[None-human] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[None-yaml] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[None-json] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[None-github-annotation] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[None-github-annotation-native] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[None-none] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[outfile-human] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[outfile-yaml] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[outfile-json] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[outfile-github-annotation] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[outfile-github-annotation-native] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_multiple_files[outfile-none] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_github_annotation 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_github_annotation_native[test/fixtures/linter/identifier_capitalisation.sql-::group::{filename}\n::error title=SQLFluff,file={filename},line=3,col=5,endLine=3,endColumn=8::RF02: Unqualified reference 'foo' found in select with more than one referenced table/view. [references.qualification]\n::error title=SQLFluff,file={filename},line=4,col=1,endLine=4,endColumn=5::LT02: Expected indent of 8 spaces. [layout.indent]\n::error title=SQLFluff,file={filename},line=4,col=5,endLine=4,endColumn=8::AL02: Implicit/explicit aliasing of columns. [aliasing.column]\n::error title=SQLFluff,file={filename},line=4,col=5,endLine=4,endColumn=8::CP02: Unquoted identifiers must be consistently lower case. [capitalisation.identifiers]\n::notice title=SQLFluff,file={filename},line=5,col=1,endLine=5,endColumn=5::CP01: Keywords must be consistently lower case. [capitalisation.keywords]\n::error title=SQLFluff,file={filename},line=5,col=12,endLine=5,endColumn=16::CP02: Unquoted identifiers must be consistently lower case. [capitalisation.identifiers]\n::error title=SQLFluff,file={filename},line=5,col=18,endLine=5,endColumn=22::CP02: Unquoted identifiers must be consistently lower case. [capitalisation.identifiers]\n::endgroup::\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_github_annotation_native[test/fixtures/linter/jinja_spacing.sql-::group::{filename}\n::error title=SQLFluff,file={filename},line=3,col=15,endLine=3,endColumn=22::JJ01: Jinja tags should have a single whitespace on either side: {{{{foo}}}} [jinja.padding]\n::endgroup::\n] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_annotation_level_error_failure_equivalent[github-annotation] 1407s FAILED test/cli/commands_test.py::test__cli__command_lint_serialize_annotation_level_error_failure_equivalent[github-annotation-native] 1407s FAILED test/cli/commands_test.py::test_encoding[utf-8-ascii] - TypeError: Cli... 1407s FAILED test/cli/commands_test.py::test_encoding[utf-8-sig-UTF-8-SIG] - TypeEr... 1407s FAILED test/cli/commands_test.py::test_encoding[utf-32-UTF-32] - TypeError: C... 1407s FAILED test/cli/commands_test.py::test_cli_encoding[utf-8-command-line-False] 1407s FAILED test/cli/commands_test.py::test_cli_encoding[utf-8-SIG-command-line-True] 1407s FAILED test/cli/commands_test.py::test_cli_encoding[utf-8-config-file-False] 1407s FAILED test/cli/commands_test.py::test_cli_encoding[utf-8-SIG-config-file-True] 1407s FAILED test/cli/commands_test.py::test_cli_no_disable_noqa_flag - TypeError: ... 1407s FAILED test/cli/commands_test.py::test_cli_disable_noqa_flag - TypeError: Cli... 1407s FAILED test/cli/commands_test.py::test_cli_disable_noqa_except_flag - TypeErr... 1407s FAILED test/cli/commands_test.py::test_cli_disable_noqa_except_non_rules_flag 1407s FAILED test/cli/commands_test.py::test_cli_warn_unused_noqa_flag - TypeError:... 1407s FAILED test/cli/commands_test.py::TestProgressBars::test_cli_lint_disabled_progress_bar 1407s FAILED test/cli/commands_test.py::TestProgressBars::test_cli_lint_enabled_progress_bar 1407s FAILED test/cli/commands_test.py::TestProgressBars::test_cli_lint_enabled_progress_bar_multiple_paths 1407s FAILED test/cli/commands_test.py::TestProgressBars::test_cli_lint_enabled_progress_bar_multiple_files 1407s FAILED test/cli/commands_test.py::test__cli__fix_multiple_errors_no_show_errors 1407s FAILED test/cli/commands_test.py::test__cli__fix_multiple_errors_quiet_force 1407s FAILED test/cli/commands_test.py::test__cli__fix_multiple_errors_quiet_check 1407s FAILED test/cli/commands_test.py::test__cli__fix_multiple_errors_show_errors 1407s FAILED test/cli/commands_test.py::test__cli__fix_show_parse_errors - TypeErro... 1407s FAILED test/cli/commands_test.py::test__cli__multiple_files__fix_multiple_errors_show_errors 1407s FAILED test/cli/commands_test.py::test__cli__render_fail - TypeError: CliRunn... 1407s FAILED test/cli/commands_test.py::test__cli__render_pass - TypeError: CliRunn... 1407s FAILED test/diff_quality_plugin_test.py::test_diff_quality_plugin[sql_paths0-expected_violations_lines0] 1407s FAILED test/diff_quality_plugin_test.py::test_diff_quality_plugin[sql_paths1-expected_violations_lines1] 1407s FAILED test/diff_quality_plugin_test.py::test_diff_quality_plugin[sql_paths2-expected_violations_lines2] 1407s FAILED test/diff_quality_plugin_test.py::test_diff_quality_plugin[sql_paths3-expected_violations_lines3] 1407s ==== 155 failed, 8364 passed, 1 skipped, 1 deselected in 1249.11s (0:20:49) ==== 1409s /tmp/autopkgtest.gvzmUI/wrapper.sh: checking for leaked background processes... 1409s /tmp/autopkgtest.gvzmUI/wrapper.sh: waiting for tee/cat subprocesses... 1409s /tmp/autopkgtest.gvzmUI/wrapper.sh: cleaning up... 1409s /tmp/autopkgtest.gvzmUI/wrapper.sh: Exit status: 1 1409s autopkgtest: DBG: testbed command exited with code 1 1409s autopkgtest [04:52:57]: test upstream: -----------------------] 1409s autopkgtest: DBG: testbed executing test finished with exit status 1 1409s autopkgtest: DBG: sending command to testbed: copyup /tmp/autopkgtest.gvzmUI/upstream-stdout /tmp/autopkgtest-work.07z5cnd3/out/upstream-stdout 1410s autopkgtest: DBG: got reply from testbed: ok 1410s autopkgtest: DBG: sending command to testbed: copyup /tmp/autopkgtest.gvzmUI/upstream-stderr /tmp/autopkgtest-work.07z5cnd3/out/upstream-stderr 1410s autopkgtest: DBG: got reply from testbed: ok 1410s autopkgtest [04:52:58]: test upstream: - - - - - - - - - - results - - - - - - - - - - 1410s upstream FAIL non-zero exit status 1 1410s autopkgtest: DBG: sending command to testbed: copyup /tmp/autopkgtest.gvzmUI/upstream-artifacts/ /tmp/autopkgtest-work.07z5cnd3/out/artifacts/ 1410s autopkgtest: DBG: got reply from testbed: ok 1410s autopkgtest: DBG: testbed command ['rm', '-rf', '/tmp/autopkgtest.gvzmUI/upstream-artifacts', '/tmp/autopkgtest.gvzmUI/autopkgtest_tmp'], kind short, sout raw, serr pipe, env [] 1411s autopkgtest: DBG: testbed command exited with code 0 1411s autopkgtest: DBG: needs_reset, previously=False, requested by run_tests() line 230 1411s autopkgtest [04:52:59]: @@@@@@@@@@@@@@@@@@@@ summary 1411s upstream FAIL non-zero exit status 1 1411s autopkgtest: DBG: testbed stop 1411s autopkgtest: DBG: testbed close, scratch=/tmp/autopkgtest.gvzmUI 1411s autopkgtest: DBG: sending command to testbed: close 1428s autopkgtest: DBG: got reply from testbed: ok 1428s autopkgtest: DBG: sending command to testbed: quit 1428s nova [W] Using flock in prodstack6-s390x 1428s Creating nova instance adt-plucky-s390x-sqlfluff-20250219-042927-juju-7f2275-prod-proposed-migration-environment-15-f24abb4b-df01-447f-8bf7-0e240a14ddc5 from image adt/ubuntu-plucky-s390x-server-20250218.img (UUID d4b3949f-1d31-4fe6-9e99-080adec067af)... 1428s nova [W] Timed out waiting for bb7f6e45-e561-4b3b-9454-07df6ab01a8d to get deleted.