Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaohanZhangCMU committed Nov 6, 2024
1 parent 27add58 commit 4922cd1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tests/data/test_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1549,19 +1549,13 @@ def test_text_dataloader_with_extra_keys():
)

device_batch_size = 2

def custom_stat_mock(path: Any):
if any([BARRIER_FILELOCK in path, CACHE_FILELOCK in path]):
if BARRIER_FILELOCK in path or CACHE_FILELOCK in path:
return original_os_stat(path)
else:
mock_stat = MagicMock()
mock_stat.st_size = 1024 # Mock st_size with a desired value
mock_stat.st_mode = 33188 # Regular file mode for Unix-based systems
return mock_stat
return MagicMock(st_size=1024, st_mode=33188) # Mock regular file attributes

original_os_stat = os.stat


#with patch('streaming.base.stream.get_shards', return_value=None):
with patch('os.makedirs'), \
patch('builtins.open', new_callable=mock_open, read_data='{"version": 2, "shards": []}'), \
Expand Down

0 comments on commit 4922cd1

Please sign in to comment.