Skip to content

Commit afe95a3

Browse files
committed
DOC: Fixture docs in pandas/conftest.py
xref: pandas-dev#19159
1 parent 6e9651e commit afe95a3

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

pandas/conftest.py

+21-8
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,28 @@ def pytest_runtest_setup(item):
6565
pytest.skip("skipping high memory test since --run-high-memory was not set")
6666

6767

68-
# Configurations for all tests and all test modules
69-
70-
7168
@pytest.fixture(autouse=True)
7269
def configure_tests():
70+
"""
71+
Configure settings for all tests and test modules.
72+
"""
7373
pd.set_option("chained_assignment", "raise")
7474

7575

76-
# For running doctests: make np and pd names available
77-
78-
7976
@pytest.fixture(autouse=True)
8077
def add_imports(doctest_namespace):
78+
"""
79+
Make `np` and `pd` names available for doctests.
80+
"""
8181
doctest_namespace["np"] = np
8282
doctest_namespace["pd"] = pd
8383

8484

8585
@pytest.fixture(params=["bsr", "coo", "csc", "csr", "dia", "dok", "lil"])
8686
def spmatrix(request):
87+
"""
88+
Yields scipy sparse matrix classes.
89+
"""
8790
from scipy import sparse
8891

8992
return getattr(sparse, request.param + "_matrix")
@@ -92,8 +95,8 @@ def spmatrix(request):
9295
@pytest.fixture(params=[0, 1, "index", "columns"], ids=lambda x: f"axis {repr(x)}")
9396
def axis(request):
9497
"""
95-
Fixture for returning the axis numbers of a DataFrame.
96-
"""
98+
Fixture for returning the axis numbers of a DataFrame.
99+
"""
97100
return request.param
98101

99102

@@ -237,6 +240,10 @@ def all_boolean_reductions(request):
237240

238241
@pytest.fixture(params=list(_cython_table))
239242
def cython_table_items(request):
243+
"""
244+
Yields a tuple of a function and its corresponding name. Correspond to
245+
the list of aggregator "Cython functions" used on selected table items.
246+
"""
240247
return request.param
241248

242249

@@ -337,6 +344,9 @@ def writable(request):
337344

338345
@pytest.fixture(scope="module")
339346
def datetime_tz_utc():
347+
"""
348+
Yields the UTC timezone object from the datetime module.
349+
"""
340350
return timezone.utc
341351

342352

@@ -358,6 +368,9 @@ def join_type(request):
358368

359369
@pytest.fixture
360370
def strict_data_files(pytestconfig):
371+
"""
372+
Returns the configuration for the test setting `--strict-data-files`.
373+
"""
361374
return pytestconfig.getoption("--strict-data-files")
362375

363376

0 commit comments

Comments
 (0)