about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-05 22:45:22 +0200
committerhut <hut@lavabit.com>2010-05-05 22:45:22 +0200
commitc6953a55e46aee37a854dff3be5d965b19a7341a (patch)
tree8ab0bfc30ce640e879f6d75b5dc639cf64101e4d /test
parentda440d3a10b7ab05e9b55968344fff2cbc45da09 (diff)
downloadranger-c6953a55e46aee37a854dff3be5d965b19a7341a.tar.gz
cleanups
Diffstat (limited to 'test')
-rw-r--r--test/tc_directory.py7
-rw-r--r--test/tc_newkeys.py2
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()