pytest-dev / pytest-dev/pytest-django

Cannot Set conn.allow_thread_sharing

Open
#938 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

On this line:
https://github.com/pytest-dev/pytest-django/blob/cf6b229bce0c717bc590d8fd7cef281f3aa2c1fa/pytest_django/live_server_helper.py#L27

When using an sqlite in-memory database, our test gets to that line and raises AttributeError: Can't set attribute

Looking at the django source code for the allow_thread_sharing property: it appears to be a read-only property.

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 at pytest_django/live_server_helper.py line 27 and reproduce the failure with an SQLite in-memory database. Compare that access with Django's allow_thread_sharing property in the linked Django source; done means the test reaches this path without the AttributeError and the relevant tests pass.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.