pydata / pydata/xarray

layout of tests

Open
#9,871 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

What is your issue?

Currently the tests are stored in a flat on-disk layout, but some test files are logically grouped, e.g. the relationship between test_backends_api.py and test_backends_common.py could be expressed via a directory structure, like test/backends/test_api.py and test/backends/test_common.py.

Relatedly, some of the test files are a bit long -- test_backends.py is 6500 lines, and it contains tests for zarr and netcdf (and maybe other things). If someone is just working on the zarr side of things, then the netcdf tests are thousands of lines of clutter that could in principle be entirely contained in a separate test file.

So my proposal would be to judiciously group logically related tests into modules , e.g. test_backends would be one, and also split large test files into smaller independent components, e.g. test_backends/test_zarr.py would just test the zarr backend stuff.

Does this seem reasonable?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing test_backends.py and the related test_backends_api.py and test_backends_common.py files. Map the logical groupings and backend-specific sections before proposing directory layouts and smaller test modules. Done means the tests are organized into focused components while preserving their existing coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.