lists.arthurdejong.org
RSS feed

python-stdnum commit: r156 - python-stdnum/stdnum

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum commit: r156 - python-stdnum/stdnum



Author: arthur
Date: Sun Feb 19 23:24:23 2012
New Revision: 156
URL: http://arthurdejong.org/viewvc/python-stdnum?revision=156&view=revision

Log:
add "pragma: no cover" statements to code that isn't expected to be covered

Modified:
   python-stdnum/stdnum/iban.py
   python-stdnum/stdnum/numdb.py

Modified: python-stdnum/stdnum/iban.py
==============================================================================
--- python-stdnum/stdnum/iban.py        Sun Feb 19 10:55:51 2012        (r155)
+++ python-stdnum/stdnum/iban.py        Sun Feb 19 23:24:23 2012        (r156)
@@ -72,7 +72,7 @@
         elif code == 'a' and not number[start:start + length].isalpha():
             return False
         elif code == 'c' and not number[start:start + length].isalnum():
-            return False  # should not happen due to checksum check
+            return False  # pragma: no cover (due to checksum check)
         start += length
     # the whole number should be parsed now
     return start == len(number)

Modified: python-stdnum/stdnum/numdb.py
==============================================================================
--- python-stdnum/stdnum/numdb.py       Sun Feb 19 10:55:51 2012        (r155)
+++ python-stdnum/stdnum/numdb.py       Sun Feb 19 23:24:23 2012        (r156)
@@ -132,7 +132,7 @@
     for line in fp:
         # ignore comments
         if line[0] == '#' or line.strip() == '':
-            continue
+            continue  # pragma: no cover (optimisation takes it out)
         # any other line should parse
         match = _line_re.search(line)
         indent = len(match.group('indent'))
-- 
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits/