Skip to content

Commit 44c56f1

Browse files
committed
moving tables from common.py to the modules requiring this
1 parent 7b640fc commit 44c56f1

File tree

3 files changed

+41
-29
lines changed

3 files changed

+41
-29
lines changed

pandas/tests/io/pytables/common.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
11
from contextlib import contextmanager
2-
from distutils.version import LooseVersion
32
import os
43
import tempfile
54

6-
import numpy as np
7-
import pytest
8-
95
from pandas.io.pytables import HDFStore
106

11-
# TODO:
12-
# remove when gh-24839 is fixed; this affects numpy 1.16
13-
# and pytables 3.4.4
14-
tables = pytest.importorskip("tables")
15-
xfail_non_writeable = pytest.mark.xfail(
16-
LooseVersion(np.__version__) >= LooseVersion("1.16")
17-
and LooseVersion(tables.__version__) < LooseVersion("3.5.1"),
18-
reason=(
19-
"gh-25511, gh-24839. pytables needs a "
20-
"release beyong 3.4.4 to support numpy 1.16x"
21-
),
22-
)
23-
24-
# set these parameters so we don't have file sharing
25-
tables.parameters.MAX_NUMEXPR_THREADS = 1
26-
tables.parameters.MAX_BLOSC_THREADS = 1
27-
tables.parameters.MAX_THREADS = 1
28-
297

308
def safe_remove(path):
319
if path is not None:

pandas/tests/io/pytables/test_hdf_complex_values.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
1+
from distutils.version import LooseVersion
12
from warnings import catch_warnings
23

34
import numpy as np
45
import pytest
56

67
import pandas as pd
78
from pandas import DataFrame, Series
8-
from pandas.tests.io.pytables.common import (
9-
ensure_clean_path,
10-
ensure_clean_store,
11-
xfail_non_writeable,
12-
)
9+
from pandas.tests.io.pytables.common import ensure_clean_path, ensure_clean_store
1310
import pandas.util.testing as tm
1411
from pandas.util.testing import assert_frame_equal
1512

1613
from pandas.io.pytables import read_hdf
1714

15+
# TODO:
16+
# remove when gh-24839 is fixed; this affects numpy 1.16
17+
# and pytables 3.4.4
18+
tables = pytest.importorskip("tables")
19+
# set these parameters so we don't have file sharing
20+
tables.parameters.MAX_NUMEXPR_THREADS = 1
21+
tables.parameters.MAX_BLOSC_THREADS = 1
22+
tables.parameters.MAX_THREADS = 1
23+
24+
25+
xfail_non_writeable = pytest.mark.xfail(
26+
LooseVersion(np.__version__) >= LooseVersion("1.16")
27+
and LooseVersion(tables.__version__) < LooseVersion("3.5.1"),
28+
reason=(
29+
"gh-25511, gh-24839. pytables needs a "
30+
"release beyong 3.4.4 to support numpy 1.16x"
31+
),
32+
)
33+
1834

1935
class TestHDFComplexValues:
2036
# GH10447

pandas/tests/io/pytables/test_hdf_store.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
ensure_clean_store,
4040
safe_close,
4141
safe_remove,
42-
tables,
43-
xfail_non_writeable,
4442
)
4543
import pandas.util.testing as tm
4644
from pandas.util.testing import assert_frame_equal, assert_series_equal
@@ -57,6 +55,26 @@
5755
from pandas.io.pytables import TableIterator # noqa: E402 isort:skip
5856

5957

58+
# TODO:
59+
# remove when gh-24839 is fixed; this affects numpy 1.16
60+
# and pytables 3.4.4
61+
tables = pytest.importorskip("tables")
62+
# set these parameters so we don't have file sharing
63+
tables.parameters.MAX_NUMEXPR_THREADS = 1
64+
tables.parameters.MAX_BLOSC_THREADS = 1
65+
tables.parameters.MAX_THREADS = 1
66+
67+
68+
xfail_non_writeable = pytest.mark.xfail(
69+
LooseVersion(np.__version__) >= LooseVersion("1.16")
70+
and LooseVersion(tables.__version__) < LooseVersion("3.5.1"),
71+
reason=(
72+
"gh-25511, gh-24839. pytables needs a "
73+
"release beyong 3.4.4 to support numpy 1.16x"
74+
),
75+
)
76+
77+
6078
_default_compressor = "blosc"
6179
ignore_natural_naming_warning = pytest.mark.filterwarnings(
6280
"ignore:object name:tables.exceptions.NaturalNameWarning"

0 commit comments

Comments
 (0)