OpenSlides / OpenSlides/openslides-backend

[relDB] Tests: get db connection in a cleaner way

Open
#3,307 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clean up low
Dominant language
Python
Stars
9
Forks
40
Avg merge
1d 22h
Merged PRs (30d)
19

Description

See tests/conftest.py db_connection function

The BaseSystemTestCase Classes connection attribute is filled from the outside currently. Filling a class variable from the outside seems a bit improper. We should probably change that at some point

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

Start with tests/conftest.py and its db_connection function, then trace how BaseSystemTestCase.connection is assigned from outside. Determine a cleaner way for the test classes to obtain the database connection without external class-variable filling. Done means the existing database-backed tests still run with connection setup contained in the test infrastructure.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.