Skip to content

Ideally should avoid hardcoded file path in tests #10344

@pllim

Description

@pllim

Description

I see things in the tests like:

ROOT = os.path.abspath(os.path.dirname(__file__))
t_comp = read(os.path.join(ROOT, filename))

Is there a reason why this is not used instead?

t_comp = read(get_pkg_data_filename(filename))

There is also a variation using DATA global variable.

One of the subpackage where I saw this was io.ascii, so cc @taldcroft and @hamogu

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions