Skip to content

Commit

Permalink
tests/conftest.py: prepare the testfile if necessary.
Browse files Browse the repository at this point in the history
The test cases rely on testfile.h5.
  • Loading branch information
Benda Xu committed Sep 22, 2021
1 parent 9f3fcac commit d7dcbb6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import sys

import os

import pytest

import tables
Expand Down Expand Up @@ -32,4 +34,7 @@ def launcher():

@pytest.fixture(scope='module')
def h5file():
return tables.open_file('testfile.h5', 'r')
if not os.path.exists('testfile.h5'):
import create_testfile
yield tables.open_file('testfile.h5', 'r')
os.remove('testfile.h5')

0 comments on commit d7dcbb6

Please sign in to comment.