diff options
author | Bob Ippolito <bob@redivi.com> | 2016-02-28 10:59:24 -0800 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2016-02-28 10:59:24 -0800 |
commit | 70dbe7f3642f4fabec2ddfd51c76fc80f707c4fe (patch) | |
tree | 56f17f4f60e84140b0b9b4c421d15ff673bf1ada /xattr | |
parent | 66fa35f3609e4db59690319a945ff471a664da99 (diff) | |
download | xattr-70dbe7f3642f4fabec2ddfd51c76fc80f707c4fe.tar.gz |
v0.8.0
Diffstat (limited to 'xattr')
-rw-r--r-- | xattr/__init__.py | 2 | ||||
-rw-r--r-- | xattr/tests/test_xattr.py | 23 |
2 files changed, 17 insertions, 8 deletions
diff --git a/xattr/__init__.py b/xattr/__init__.py index c5e8433..dad8e5a 100644 --- a/xattr/__init__.py +++ b/xattr/__init__.py @@ -7,7 +7,7 @@ The xattr type wraps a path or file descriptor with a dict-like interface that exposes these extended attributes. """ -__version__ = '0.7.9' +__version__ = '0.8.0' from .lib import (XATTR_NOFOLLOW, XATTR_CREATE, XATTR_REPLACE, XATTR_NOSECURITY, XATTR_MAXNAMELEN, XATTR_FINDERINFO_NAME, diff --git a/xattr/tests/test_xattr.py b/xattr/tests/test_xattr.py index 1e33fa0..548f735 100644 --- a/xattr/tests/test_xattr.py +++ b/xattr/tests/test_xattr.py @@ -1,6 +1,7 @@ import os import sys -from unittest import TestCase, SkipTest +import unittest +from unittest import TestCase from tempfile import mkdtemp, NamedTemporaryFile import xattr @@ -88,12 +89,6 @@ class TestFile(TestCase, BaseTestXattr): def tearDown(self): self.tempfile.close() -class TestFileWithSurrogates(TestFile): - def setUp(self): - if sys.platform != 'linux': - raise SkipTest('Files with invalid encoded names are only supported under linux') - self.tempfile = NamedTemporaryFile(prefix=b'invalid-\xe9'.decode('utf8','surrogateescape')) - self.tempfilename = self.tempfile.name class TestDir(TestCase, BaseTestXattr): def setUp(self): @@ -102,3 +97,17 @@ class TestDir(TestCase, BaseTestXattr): def tearDown(self): os.rmdir(self.tempfile) + + +try: + # SkipTest is only available in Python 2.7+ + unittest.SkipTest +except AttributeError: + pass +else: + class TestFileWithSurrogates(TestFile): + def setUp(self): + if sys.platform != 'linux': + raise unittest.SkipTest('Files with invalid encoded names are only supported under linux') + self.tempfile = NamedTemporaryFile(prefix=b'invalid-\xe9'.decode('utf8','surrogateescape')) + self.tempfilename = self.tempfile.name |