]> Devi Nivas Git - chevron.git/commitdiff
Ignore python 2 specific areas in coverage
authornoah morrison <noah@morrison.ph>
Tue, 18 Nov 2014 17:30:44 +0000 (12:30 -0500)
committernoah morrison <noah@morrison.ph>
Tue, 18 Nov 2014 17:30:44 +0000 (12:30 -0500)
coverage now ignores any lines with
    # python 2
in them.

.coveragerc
chevron.py

index fe258c6c6a89b664bcba6816b5786b375c7daf74..376e1abbb66f2e86709127ae4a444e74db56f665 100644 (file)
@@ -1,3 +1,5 @@
 [report]
 exclude_lines =
     if __name__ == .__main__.:
+
+    \# python 2
index dd2f49ae063d5a332e149c1e1eb8e50d31c95a98..3d97b9951a76632970b50a4fb39a08153da15a50 100755 (executable)
@@ -4,7 +4,7 @@ import json
 
 from sys import argv
 
-try:
+try:  # python 2
     unicode
     python3 = False
 except:
@@ -370,12 +370,12 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache',
             # Add the partials output to the ouput
             if python3:
                 output += part_out
-            else:
+            else:  # python 2
                 output += part_out.decode('utf-8')
 
     if python3:
         return output
-    else:
+    else:  # python 2
         return output.encode('utf-8')