Skip to content
Browse files

Less brittle test.

  • Loading branch information...
1 parent e3b18f1 commit 725e699007d4cb939d1afb0fff2f531059567c1c @chrisrossi chrisrossi committed Oct 23, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 acidfs/tests.py
View
12 acidfs/tests.py
@@ -278,15 +278,23 @@ 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):
fs = self.make_one()
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):

0 comments on commit 725e699

Please sign in to comment.
Something went wrong with that request. Please try again.