[Python-modules-commits] r31343 - in packages/python-flake8/trunk/debian (changelog tests/tools)
noskcaj-guest at users.alioth.debian.org
noskcaj-guest at users.alioth.debian.org
Sat Nov 1 01:37:00 UTC 2014
Date: Saturday, November 1, 2014 @ 01:36:28
Author: noskcaj-guest
Revision: 31343
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. Closes: #742482
Modified:
packages/python-flake8/trunk/debian/changelog
packages/python-flake8/trunk/debian/tests/tools
Modified: packages/python-flake8/trunk/debian/changelog
===================================================================
--- packages/python-flake8/trunk/debian/changelog 2014-11-01 01:33:09 UTC (rev 31342)
+++ packages/python-flake8/trunk/debian/changelog 2014-11-01 01:36:28 UTC (rev 31343)
@@ -2,6 +2,9 @@
* Team upload
* New upstream release
+ * 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. Closes: #742482
-- Jackson Doak <noskcaj at ubuntu.com> Sat, 01 Nov 2014 12:26:44 +1100
Modified: packages/python-flake8/trunk/debian/tests/tools
===================================================================
--- packages/python-flake8/trunk/debian/tests/tools 2014-11-01 01:33:09 UTC (rev 31342)
+++ packages/python-flake8/trunk/debian/tests/tools 2014-11-01 01:36:28 UTC (rev 31343)
@@ -1,5 +1,29 @@
#!/bin/sh
set -efu
-cd $ADTTMP
-flake8
\ No newline at end of file
+# 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
More information about the Python-modules-commits
mailing list