Skip to content

TST/API: Simplify testing functions API #10788

Closed
@sinhrks

Description

@sinhrks

Derived from #10507. Consider better API for testing functions.

1. How to specify comparison tolerance

Current assert functions have check_less_precise and check_exact flags to specify how to compare values:

  • check_exact=True: Use assert_equal, comparison using ==.
  • check_exact=False and check_less_precise=False: Use assert_almost_equal, comparing 5 digits after decimal points (default)
  • check_exact=False and check_less_precise=True: Use assert_almost_equal, comparing 3 digits after decimal points

There can be single kw to specify above behaviors?

2. Make integrated assert function

I think it's nice to have test functions which supports all pandas objects for users who is starting contribution / using pandas as their dependencies. Changing assertEquals and assertAlmostEquals to internally use current assert_index/series/frame_equal is one idea.

3. Remove assert_almost_equal

Remove assert_almost_equal and use class-based validation method. Also add input type validation to numpy_assert_array_equal.

xref #9895.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignCleanTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions