Repository: borgbackup/borg

Issue:
coverage exclusion of the "support" dir does not work
```
==> wheezy32: ---------------- coverage: platform linux, python 3.3.0-final-0 ----------------
==> wheezy32: Name                                                         Stmts   Miss  Cover
==> wheezy32: --------------------------------------------------------------------------------
==> wheezy32: py33/lib/python3.3/site-packages/borg/__init__                   1      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/__main__                   2      2     0%
==> wheezy32: py33/lib/python3.3/site-packages/borg/_version                   1      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/archive                  650     77    88%
==> wheezy32: py33/lib/python3.3/site-packages/borg/archiver                 540     94    83%
==> wheezy32: py33/lib/python3.3/site-packages/borg/cache                    327     27    92%
==> wheezy32: py33/lib/python3.3/site-packages/borg/conftest                   0      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/fuse                     200    200     0%
==> wheezy32: py33/lib/python3.3/site-packages/borg/helpers                  485     85    82%
==> wheezy32: py33/lib/python3.3/site-packages/borg/key                      292     58    80%
==> wheezy32: py33/lib/python3.3/site-packages/borg/locking                  197     21    89%
==> wheezy32: py33/lib/python3.3/site-packages/borg/logger                    23      2    91%
==> wheezy32: py33/lib/python3.3/site-packages/borg/lrucache                  31      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/platform                  12      9    25%
==> wheezy32: py33/lib/python3.3/site-packages/borg/remote                   208     22    89%
==> wheezy32: py33/lib/python3.3/site-packages/borg/repository               516     34    93%
==> wheezy32: py33/lib/python3.3/site-packages/borg/support/__init__           0      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/support/argparse        1190    335    72%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/__init__        80     14    82%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/archive         81      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/archiver       617     58    91%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/benchmark       60     45    25%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/chunker         25      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/compress        68      3    96%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/crypto          32      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/hashindex       81      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/helpers        306     22    93%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/key             77      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/locking         94      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/logger          33      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/lrucache        48      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/platform        95     65    32%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/repository     273      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/upgrader        85      2    98%
==> wheezy32: py33/lib/python3.3/site-packages/borg/testsuite/xattr           32      0   100%
==> wheezy32: py33/lib/python3.3/site-packages/borg/upgrader                 121     25    79%
==> wheezy32: py33/lib/python3.3/site-packages/borg/xattr                    221    149    33%
==> wheezy32: --------------------------------------------------------------------------------
==> wheezy32: TOTAL                                                         7104   1349    81%
==> wheezy32:  2 failed, 208 passed, 112 skipped, 3 xpassed, 1 pytest-warnings, 1 error in 166.62 seconds 
```



Discussion:

Resolving patch:
diff --git a/borg/platform.py b/borg/platform.py
--- a/borg/platform.py
+++ b/borg/platform.py
@@ -1,12 +1,12 @@
 import sys
 
-if sys.platform.startswith('linux'):
+if sys.platform.startswith('linux'):  # pragma: linux only
     from .platform_linux import acl_get, acl_set, API_VERSION
-elif sys.platform.startswith('freebsd'):
+elif sys.platform.startswith('freebsd'):  # pragma: freebsd only
     from .platform_freebsd import acl_get, acl_set, API_VERSION
-elif sys.platform == 'darwin':
+elif sys.platform == 'darwin':  # pragma: darwin only
     from .platform_darwin import acl_get, acl_set, API_VERSION
-else:
+else:  # pragma: unknown platform only
     API_VERSION = 2
 
     def acl_get(path, item, st, numeric_owner=False):
diff --git a/borg/xattr.py b/borg/xattr.py
--- a/borg/xattr.py
+++ b/borg/xattr.py
@@ -36,7 +36,7 @@ def _check(rv, path=None):
         raise OSError(get_errno(), path)
     return rv
 
-if sys.platform.startswith('linux'):
+if sys.platform.startswith('linux'):  # pragma: linux only
     libc.llistxattr.argtypes = (c_char_p, c_char_p, c_size_t)
     libc.llistxattr.restype = c_ssize_t
     libc.flistxattr.argtypes = (c_int, c_char_p, c_size_t)
@@ -100,7 +100,7 @@ def setxattr(path, name, value, *, follow_symlinks=True):
             func = libc.lsetxattr
         _check(func(path, name, value, len(value) if value else 0, 0), path)
 
-elif sys.platform == 'darwin':
+elif sys.platform == 'darwin':  # pragma: darwin only
     libc.listxattr.argtypes = (c_char_p, c_char_p, c_size_t, c_int)
     libc.listxattr.restype = c_ssize_t
     libc.flistxattr.argtypes = (c_int, c_char_p, c_size_t)
@@ -166,7 +166,7 @@ def setxattr(path, name, value, *, follow_symlinks=True):
             flags = XATTR_NOFOLLOW
         _check(func(path, name, value, len(value) if value else 0, 0, flags), path)
 
-elif sys.platform.startswith('freebsd'):
+elif sys.platform.startswith('freebsd'):  # pragma: freebsd only
     EXTATTR_NAMESPACE_USER = 0x0001
     libc.extattr_list_fd.argtypes = (c_int, c_int, c_char_p, c_size_t)
     libc.extattr_list_fd.restype = c_ssize_t
@@ -247,7 +247,7 @@ def setxattr(path, name, value, *, follow_symlinks=True):
             func = libc.extattr_set_link
         _check(func(path, EXTATTR_NAMESPACE_USER, name, value, len(value) if value else 0), path)
 
-else:
+else:  # pragma: unknown platform only
     def listxattr(path, *, follow_symlinks=True):
         return []
 


Test patch: