Skip to content

Remove needless functions from an io.ascii test helper file #15782

Closed

Description

@eerovaher

What is the problem this feature will solve?

A helper file in io.ascii tests contains three functions that serve little purpose:

# Compatibility functions to convert from nose to pytest
def assert_equal(a, b):
assert a == b
def assert_almost_equal(a, b, **kwargs):
assert np.allclose(a, b, **kwargs)
def assert_true(a):
assert a

Describe the desired outcome

The aforementioned functions should be removed and any tests still using them should be updated accordingly. Pull requests targeting one or more functions are welcome.

Potential contributors can have a look at #16644 that removed the helper functions from one file and use that as an example.

Additional context

assert_equal() and assert_true() should be inlined, but assert_almost_equal(a, b) should be replaced with np.testing.assert_allclose(a, b) instead of assert np.allclose(a, b) because the dedicated testing function produces a better error message if the check fails.

Performed removals

  • assert_equal()
  • assert_almost_equal()
  • assert_true()

Activity

  1. pllim commented on Dec 22, 2023

    @pllim
    Member

    Looks like @taldcroft added these a long time ago. Are other io.ascii maintainers on board with this? I don't see any link to previous discussions.

  2. taldcroft commented on Dec 23, 2023

    @taldcroft
    Member

    Fine by me. I would expect there was a reason for these functions in the days of yore, but I don't see a reason now.

  3. Rohit-Pujari commented on Dec 23, 2023

    @Rohit-Pujari
  4. pllim commented on Dec 23, 2023

    @pllim
  5. Rohit-Pujari commented on Dec 23, 2023

    @Rohit-Pujari
  6. vagish-yadav commented on Jan 14, 2024

    @vagish-yadav
  7. eerovaher commented on Jul 1, 2024

    @eerovaher
    MemberAuthor

    I re-added the good first issue label because now there is an example pull request potential contributors can follow: #16644.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions