Skip to content

QST: Is Using pandas.test() Equivalent to Running pytest Directly? #60467

@angiolye24

Description

@angiolye24

Research

  • I have searched the [pandas] tag on StackOverflow for similar questions.

  • I have asked my usage related question on StackOverflow.

Link to question on StackOverflow

https://stackoverflow.com/questions/79244236/is-using-pandas-test-equivalent-to-running-pytest-directly

Question about pandas

I'm working with the pandas codebase and using the _tester.py module located at pandas/util/_tester.py to execute tests. Specifically, I'm calling the pandas.test() function to run the test suite. Here’s how I’m doing it:

import pandas
pandas.test()

I can run the same tests directly with a pytest command, for example:

python3.12 -m pytest --cov=pandas --cov-report=term-missing --cov-branch pandas/tests/api/test_api.py::TestApi::test_api_indexers

Are these two approaches (pandas.test() and running pytest directly) functionally equivalent?

Does using pandas.test() introduce any additional overhead compared to directly invoking pytest? For example:

Does the wrapper preprocess or filter the test suite in any way?

Are there any significant differences in performance or the way results are handled?

In large test suites, would one approach be more efficient or recommended over the other?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssue that has not been reviewed by a pandas team memberUsage Question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions