-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconftest.py
More file actions
31 lines (22 loc) · 1018 Bytes
/
Copy pathconftest.py
File metadata and controls
31 lines (22 loc) · 1018 Bytes
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
"""Configure tests"""
import os
import pandas as pd
def pytest_configure():
"""Configure pandas display options for doctests.
Controls DataFrame output formatting to produce consistent,
truncated output with ellipsis in doctests.
"""
os.environ.setdefault("COLUMNS", "100")
# Terminal width for DataFrame display (in characters)
width = int(os.environ.get("PANDAS_DISPLAY_WIDTH", 100))
pd.set_option("display.width", width)
# Number of columns to show before truncating with ellipsis
max_cols = int(os.environ.get("PANDAS_MAX_COLUMNS", 6))
pd.set_option("display.max_columns", max_cols)
# Number of rows to display
max_rows = int(os.environ.get("PANDAS_MAX_ROWS", 4))
pd.set_option("display.max_rows", max_rows)
# Don't expand DataFrame repr across multiple lines
pd.set_option("display.expand_frame_repr", False)
# Show summary info line if truncated (e.g., "[2 rows x 11 columns]")
pd.set_option("display.show_dimensions", "truncate")