From 725e699007d4cb939d1afb0fff2f531059567c1c Mon Sep 17 00:00:00 2001 From: Chris Rossi Date: Tue, 23 Oct 2012 10:43:09 -0400 Subject: [PATCH] Less brittle test. --- acidfs/tests.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/acidfs/tests.py b/acidfs/tests.py index 473a0f1..c6be15f 100644 --- a/acidfs/tests.py +++ b/acidfs/tests.py @@ -278,7 +278,11 @@ def test_error_writing_blob(self): fs = self.make_one() with self.assertRaises((IOError, subprocess.CalledProcessError)): with fs.open('foo', 'wb') as f: - shutil.rmtree(os.path.join(self.tmp, '.git')) + wait = f.raw.proc.wait + def dummy_wait(): + wait() + return 1 + f.raw.proc.wait = dummy_wait fprint(f, b'Howdy!') def test_error_reading_blob(self): @@ -286,7 +290,11 @@ def test_error_reading_blob(self): fs.open('foo', 'wb').write(b'a' * 10000) with self.assertRaises(subprocess.CalledProcessError): with fs.open('foo', 'rb') as f: - shutil.rmtree(os.path.join(self.tmp, '.git')) + wait = f.raw.proc.wait + def dummy_wait(): + wait() + return 1 + f.raw.proc.wait = dummy_wait f.read() def test_append(self):