Skip to content

DOC/CLN: pd.test #46714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/deps/actions-310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- pytest>=6.0
- pytest-cov
- pytest-xdist>=1.31
- hypothesis>=5.5.3
- psutil
- pytest-asyncio>=0.17
- boto3
Expand All @@ -27,6 +26,7 @@ dependencies:
- fastparquet
- fsspec
- html5lib
- hypothesis
- gcsfs
- jinja2
- lxml
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- pytest>=6.0
- pytest-cov
- pytest-xdist>=1.31
- hypothesis>=5.5.3
- psutil
- pytest-asyncio>=0.17
- boto3
Expand All @@ -28,6 +27,7 @@ dependencies:
- fastparquet
- fsspec
- html5lib
- hypothesis
- gcsfs
- jinja2
- lxml
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies:
- pytest>=6.0
- pytest-cov
- pytest-xdist>=1.31
- hypothesis>=5.5.3
- psutil
- pytest-asyncio>=0.17
- boto3
Expand All @@ -29,6 +28,7 @@ dependencies:
- fastparquet=0.4.0
- fsspec=0.7.4
- html5lib=1.1
- hypothesis=5.5.3
- gcsfs=0.6.0
- jinja2=2.11
- lxml=4.5.0
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- pytest>=6.0
- pytest-cov
- pytest-xdist>=1.31
- hypothesis>=5.5.3
- psutil
- pytest-asyncio>=0.17
- boto3
Expand All @@ -27,6 +26,7 @@ dependencies:
- fastparquet
- fsspec
- html5lib
- hypothesis
- gcsfs
- jinja2
- lxml
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- pytest>=6.0
- pytest-cov
- pytest-xdist>=1.31
- hypothesis>=5.5.3
- psutil
- pytest-asyncio>=0.17
- boto3
Expand All @@ -27,6 +26,7 @@ dependencies:
- fastparquet
- fsspec
- html5lib
- hypothesis
- gcsfs
- jinja2
- lxml
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/circle-38-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- pytest>=6.0
- pytest-cov
- pytest-xdist>=1.31
- hypothesis>=5.5.3
- psutil
- pytest-asyncio>=0.17
- boto3
Expand All @@ -27,6 +26,7 @@ dependencies:
- fastparquet
- fsspec
- html5lib
- hypothesis
- gcsfs
- jinja2
- lxml
Expand Down
1 change: 1 addition & 0 deletions pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"fastparquet": "0.4.0",
"fsspec": "0.7.4",
"html5lib": "1.1",
"hypothesis": "5.5.3",
"gcsfs": "0.6.0",
"jinja2": "2.11",
"lxml.etree": "4.5.0",
Expand Down
23 changes: 14 additions & 9 deletions pandas/util/_tester.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
"""
Entrypoint for testing from the top-level namespace.
"""
from __future__ import annotations

import os
import sys

from pandas.compat._optional import import_optional_dependency

PKG = os.path.dirname(os.path.dirname(__file__))


def test(extra_args=None):
def test(extra_args: list[str] | None = None):
"""
Run the pandas test suite using pytest.

By default, runs with the marks --skip-slow, --skip-network, --skip-db

Parameters
----------
extra_args : list[str], default None
Extra marks to run the tests.
"""
try:
import pytest
except ImportError as err:
raise ImportError("Need pytest>=5.0.1 to run tests") from err
try:
import hypothesis # noqa:F401
except ImportError as err:
raise ImportError("Need hypothesis>=3.58 to run tests") from err
pytest = import_optional_dependency("pytest")
import_optional_dependency("hypothesis")
cmd = ["--skip-slow", "--skip-network", "--skip-db"]
if extra_args:
if not isinstance(extra_args, list):
Expand Down