diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/tc_directory.py | 7 | ||||
-rw-r--r-- | test/tc_newkeys.py | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/test/tc_directory.py b/test/tc_directory.py index f1b204c3..024ebc9d 100644 --- a/test/tc_directory.py +++ b/test/tc_directory.py @@ -15,6 +15,7 @@ if __name__ == '__main__': from __init__ import init; init() +import sys from os.path import realpath, join, dirname from ranger import fsobject @@ -38,7 +39,8 @@ class Test1(unittest.TestCase): self.assertFalse(dir.content_loaded) self.assertEqual(dir.filenames, None) self.assertEqual(dir.files, None) - self.assertRaises(fsobject.NotLoadedYet, len, dir) + if not sys.flags.optimize: # asserts are ignored with python -O + self.assertRaises(AssertionError, len, dir) def test_after_content_loaded(self): import os @@ -79,7 +81,8 @@ class Test1(unittest.TestCase): self.assertFalse(dir.exists) self.assertFalse(dir.accessible) self.assertEqual(dir.filenames, None) - self.assertRaises(fsobject.NotLoadedYet, len, dir) + if not sys.flags.optimize: # asserts are ignored with python -O + self.assertRaises(AssertionError, len, dir) def test_load_if_outdated(self): import os diff --git a/test/tc_newkeys.py b/test/tc_newkeys.py index 2a44e0e8..c7a33025 100644 --- a/test/tc_newkeys.py +++ b/test/tc_newkeys.py @@ -424,7 +424,7 @@ class Test(PressTestCase): self.assertPressFails(kb, 'xzy') self.assertPressIncomplete(kb, 'xx') self.assertPressIncomplete(kb, 'x') - if not sys.flags.optimize: + if not sys.flags.optimize: # asserts are ignored with python -O self.assertRaises(AssertionError, simulate_press, kb, 'xxx') kb.clear() |