Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

test: fail when a file in `src/dkit/data/` is not registered in `DATASETS`

Open Beginner friendly
#84 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
80/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

Start with tests/test_data.py and core/data.py, especially data.load() and its importlib.resources usage. Add a test comparing the packaged *.json filenames without extensions against data.DATASETS, reporting names missing from either side, and checking for duplicate registrations. Run the targeted data tests, then verify the test fails with an unregistered file and with a registered name lacking a file; remove the dummy file afterward.

Written by the indexing model from the issue text.

Description

good first issue testing

core/data.py has a list DATASETS, and the data tests (tests/test_data.py) run for every name in it: the file loads, and it has a source and a valid last_verified date. But nothing checks the other direction. If someone adds src/dkit/data/new_file.json and forgets to add "new_file" to DATASETS, every test stays green and the file is never checked for provenance.

CI only counts the JSON files in the wheel, and that number is bumped by hand, so it does not catch this either.

What to do

Add a test to tests/test_data.py that compares the files that actually exist with the registered names:

  • List the *.json files in the dkit.data package folder (use importlib.resources, like data.load() does, so it also works for an installed package).
  • Assert that the set of file names (without .json) equals set(data.DATASETS).
  • The failure message should say which names are missing on which side, so the contributor knows what to fix.
  • DATASETS should also contain no duplicates (one more assertion).

Acceptance criteria

  • The test fails if you add a dummy src/dkit/data/zzz.json without registering it, and fails if you add "zzz" to DATASETS without a file. Please say in the PR description that you tried both (and removed the dummy file again).
  • 100% line and branch coverage, ruff check and ruff format --check clean.
  • No change to the data files or to the CI file count, no CHANGELOG entry needed (tests only).

Please comment on this issue before you start (see CONTRIBUTING.md). AI-assisted contributions are welcome, please mention it in the PR description.

Dominant language
Python
Stars
1
Forks
7
Avg merge
5h 5m
Merged PRs (30d)
30

Getting set up

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.

More from Bytewave1/dkit

All issues in Bytewave1/dkit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.