File: pytest_reload_pandas_test.py

package info (click to toggle)
python-pyfakefs 5.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,476 kB
  • sloc: python: 20,153; makefile: 4
file content (34 lines) | stat: -rw-r--r-- 723 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""Regression test for #947.
Ensures that reloading the `pandas.core.arrays.arrow.extension_types` module succeeds.
"""

from pathlib import Path

import pytest

try:
    import pandas as pd
except ImportError:
    pd = None

try:
    import parquet
except ImportError:
    parquet = None


@pytest.mark.skipif(
    pd is None or parquet is None, reason="pandas or parquet not installed"
)
def test_1(fs):
    dir_ = Path(__file__).parent / "data"
    fs.add_real_directory(dir_)
    pd.read_parquet(dir_ / "test.parquet")


@pytest.mark.skipif(
    pd is None or parquet is None, reason="pandas or parquet not installed"
)
def test_2():
    dir_ = Path(__file__).parent / "data"
    pd.read_parquet(dir_ / "test.parquet")