Skip to content

Commit

Permalink
fix unittest for recent macos versions
Browse files Browse the repository at this point in the history
  • Loading branch information
9001 committed Nov 27, 2020
1 parent 300c019 commit db65d05
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_vfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import print_function, unicode_literals

import os
import time
import json
import shutil
import unittest
Expand Down Expand Up @@ -59,8 +60,15 @@ def get_ramdisk(self):

if os.path.exists("/Volumes"):
devname, _ = self.chkcmd("hdiutil", "attach", "-nomount", "ram://8192")
_, _ = self.chkcmd("diskutil", "eraseVolume", "HFS+", "cptd", devname)
return "/Volumes/cptd"
for _ in range(10):
try:
_, _ = self.chkcmd("diskutil", "eraseVolume", "HFS+", "cptd", devname)
return "/Volumes/cptd"
except:
print('lol macos')
time.sleep(0.25)

raise Exception("ramdisk creation failed")

raise Exception("TODO support windows")

Expand Down

0 comments on commit db65d05

Please sign in to comment.