MCPcopy
hub / github.com/pandas-dev/pandas / ignore_doctest_warning

Function ignore_doctest_warning

pandas/conftest.py:134–149  ·  view source on GitHub ↗

Ignore doctest warning. Parameters ---------- item : pytest.Item pytest test item. path : str Module path to Python object, e.g. "pandas.DataFrame.append". A warning will be filtered when item.name ends with in given path. So it is sufficient to speci

(item: pytest.Item, path: str, message: str)

Source from the content-addressed store, hash-verified

132
133
134def ignore_doctest_warning(item: pytest.Item, path: str, message: str) -> None:
135 """Ignore doctest warning.
136
137 Parameters
138 ----------
139 item : pytest.Item
140 pytest test item.
141 path : str
142 Module path to Python object, e.g. "pandas.DataFrame.append". A
143 warning will be filtered when item.name ends with in given path. So it is
144 sufficient to specify e.g. "DataFrame.append".
145 message : str
146 Message to be filtered.
147 """
148 if item.name.endswith(path):
149 item.add_marker(pytest.mark.filterwarnings(f"ignore:{message}"))
150
151
152def pytest_collection_modifyitems(items, config) -> None:

Callers 1

Calls 1

endswithMethod · 0.80

Tested by

no test coverage detected