opensafely-core / opensafely-core/opencodelists

Consider refactoring BNF coding systems import data to be like other tests

Open
#2,335 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

deck-scrubbing
Dominant language
Python
Stars
60
Forks
16
Avg merge
4d 12h
Merged PRs (30d)
17

Description

As mentioned in #2264, test_import_data.py for the BNF coding system currently uses a pytest fixture for the data to be imported.

Other analogous tests for other coding systems use repository data fixtures instead; example.

We could make these tests slightly more uniform by making the BNF import data tests do the same: use a repository data fixture, instead of a generated-by-pytest fixture.

On the other hand, we may later refactor these code and tests entirely, and it may not be worth doing.

Contributor guide

No contributing guide indexed for this repository

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

Compare coding_systems/bnf/tests/test_import_data.py with the analogous coding_systems/dmd/tests/test_import_data.py, focusing on how each test obtains import data. Check whether the BNF tests can use a repository data fixture in the same way; the work is done when the BNF tests use that fixture consistently, if this refactor is still wanted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.