BF: fixed up conditioning of tests under cygwin (still 3 fail)

pull/330/head
Yaroslav Halchenko 2013-08-08 22:58:06 -04:00
parent a120ff191a
commit 2aa8ddea4d
2 changed files with 6 additions and 5 deletions

View File

@ -67,10 +67,12 @@ option = %s
os.chmod(f, 0)
# fragile test and known to fail e.g. under Cygwin where permissions
# seems to be not enforced, thus condition
if not os.access('d.conf', os.R_OK):
if not os.access(f, os.R_OK):
self.assertFalse(self.c.read('d')) # should not be readable BUT present
else:
raise unittest.SkipTest("Skipping on %s -- access rights are not enforced" % platform)
# SkipTest introduced only in 2.7 thus can't yet use generally
# raise unittest.SkipTest("Skipping on %s -- access rights are not enforced" % platform)
pass
def testOptionalDotDDir(self):

View File

@ -84,9 +84,8 @@ def _assert_equal_entries(utest, found, output, count=None):
if len(output) > 3 and count is None: # match matches
# do not check if custom count (e.g. going through them twice)
if os.linesep != '\n' or sys.platform.startswith('cygwin'):
# on those where text file lines end with '\r\n', override
# repr for this test to disregard trailing CR LF
srepr = lambda x: repr(str(x).rstrip('\n\r'))
# on those where text file lines end with '\r\n', remove '\r'
srepr = lambda x: repr(x).replace(r'\r', '')
else:
srepr = repr
utest.assertEqual(srepr(found[3]), srepr(output[3]))