[Python-modules-team] Bug#742482: Fix broken autopkgtest
Martin Pitt
martin.pitt at ubuntu.com
Mon Mar 24 09:32:46 UTC 2014
Package: python-flake8
Version: 2.1.0-1
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch trusty
User: autopkgtest-devel at lists.alioth.debian.org
Usertags: autopkgtest
Hello,
python-flake8's autopkgtest currently fails [1]:
| adt-run: & apt0t-tools: - - - - - - - - - - results - - - - - - - - - -
| apt0t-tools FAIL non-zero exit status 2
| adt-run: & apt0t-tools: - - - - - - - - - - stderr - - - - - - - - - -
| Usage: flake8 [options] input ...
|
| flake8: error: input not specified
The current test only calls "flake8" without any arguments in $ADTTMP
(which is empty), so that makes no sense. I fixed the test to do
something sensible now, and tested it in schroot and LXC.
Thanks for considering,
Martin
[1] http://ci.debian.net/#package/python-flake8
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
-------------- next part --------------
diff -Nru python-flake8-2.1.0/debian/changelog python-flake8-2.1.0/debian/changelog
--- python-flake8-2.1.0/debian/changelog 2014-02-26 19:49:19.000000000 +0100
+++ python-flake8-2.1.0/debian/changelog 2014-03-24 10:29:01.000000000 +0100
@@ -1,3 +1,11 @@
+python-flake8 (2.1.0-1ubuntu1) trusty; urgency=medium
+
+ * debian/tests/tools: Call flake8 on some actual files (setup.py as a
+ known-good one, and a synthetic one for a known-bad one) instead of
+ without arguments on an empty directory.
+
+ -- Martin Pitt <martin.pitt at ubuntu.com> Mon, 24 Mar 2014 10:28:25 +0100
+
python-flake8 (2.1.0-1) unstable; urgency=low
* Team upload.
diff -Nru python-flake8-2.1.0/debian/tests/tools python-flake8-2.1.0/debian/tests/tools
--- python-flake8-2.1.0/debian/tests/tools 2014-02-26 19:43:32.000000000 +0100
+++ python-flake8-2.1.0/debian/tests/tools 2014-03-24 10:28:23.000000000 +0100
@@ -1,5 +1,29 @@
#!/bin/sh
set -efu
-cd $ADTTMP
-flake8
\ Kein Zeilenumbruch am Dateiende.
+# setup.py should be clean
+flake8 setup.py
+
+# create a known-bad file
+cat << EOF > $ADTTMP/test.py
+import sys # unused import
+
+print('Hello world, this is an overly long line for PEP-8. We expect flake8 to complain')
+# undeclared variable
+count += 1
+EOF
+set +e
+flake8 $ADTTMP/test.py > $ADTTMP/out
+RC=$?
+set -e
+echo 'flake8 output on known-bad file:'
+cat $ADTTMP/out
+
+if [ $RC -eq 0 ]; then
+ echo "flake8 expected to fail, but it succeeded:" >&2
+ exit 1
+fi
+
+grep -q 'F401.*sys' $ADTTMP/out
+grep -q 'E501.*line too long' $ADTTMP/out
+grep -q 'F821.*count' $ADTTMP/out
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20140324/1933d4d6/attachment.sig>
More information about the Python-modules-team
mailing list