Skip to content

Guidance on types of tests to write for plotting functions #771

@willschlitzer

Description

@willschlitzer

The testing section on the contributing guide does a good job of explaining how to write tests, but doesn't really explain what should and should not be tested with the plotting functions. Looking through the tests (specifically the ones testing functions in base_plotting.py) there doesn't appear to be a standard for testing functions that pass arguments to the GMT API. My limited understanding makes me think the most important thing to test is the function's ability to take arguments for its aliases and pass them to GMT. There are some tests (such as test_basemap_winkel_tripel() and test_basemap_power_axis() in test_basemap.py and many of the tests in test_colorbar.py) that test passing different arguments to the same parameters. While I understand the importance of testing that these will return functions, any errors seem like they would be upstream issues with GMT and not an issue with PyGMT itself. In an effort to standardize writing tests and reducing the amount of time spent testing, could there be some community consensus (and formal guidance) on how each wrapped GMT function should be tested?

I'm happy to implement/change tests once a standard has been decided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationmaintenanceBoring but important stuff for the core devsquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions