Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP/RFC] Setup Django only later (pytest_configure) #719

Closed
wants to merge 5 commits into from

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Apr 21, 2019

No description provided.

This is required for when conftests are loaded before Django gets setup
(i.e. when it would be done in pytest_configure only).  Not necessary,
but easier to improve things from there.
@codecov-io
Copy link

Codecov Report

Merging #719 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #719   +/-   ##
=====================================
  Coverage      98%    98%           
=====================================
  Files          32     32           
  Lines        1853   1853           
  Branches      147    147           
=====================================
  Hits         1816   1816           
  Misses         24     24           
  Partials       13     13
Flag Coverage Δ
#dj110 85.75% <100%> (ø) ⬆️
#dj111 88.01% <100%> (ø) ⬆️
#dj18 86.72% <100%> (ø) ⬆️
#dj19 85.75% <100%> (ø) ⬆️
#dj20 87.96% <100%> (ø) ⬆️
#dj21 85.48% <100%> (ø) ⬆️
#dj22 83.37% <100%> (ø) ⬆️
#djmaster 81.38% <100%> (?)
#mysql_innodb 86.23% <100%> (ø) ⬆️
#mysql_myisam 86.07% <100%> (ø) ⬆️
#postgres 91.2% <100%> (ø) ⬆️
#py27 91.04% <100%> (ø) ⬆️
#py34 85.75% <100%> (ø) ⬆️
#py35 85.75% <100%> (ø) ⬆️
#py36 88.88% <100%> (+0.37%) ⬆️
#py37 85.86% <100%> (ø) ⬆️
#pytest41 85.21% <100%> (ø) ⬆️
#sqlite 90.39% <100%> (ø) ⬆️
#sqlite_file 85.75% <100%> (ø) ⬆️
#xdist 87.96% <100%> (ø) ⬆️
Impacted Files Coverage Δ
tests/conftest.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 787bbec...b03ea36. Read the comment docs.

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #719 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #719   +/-   ##
=====================================
  Coverage      98%    98%           
=====================================
  Files          32     32           
  Lines        1853   1853           
  Branches      147    147           
=====================================
  Hits         1816   1816           
  Misses         24     24           
  Partials       13     13
Flag Coverage Δ
#dj110 85.75% <100%> (ø) ⬆️
#dj111 88.01% <100%> (ø) ⬆️
#dj18 86.72% <100%> (ø) ⬆️
#dj19 85.75% <100%> (ø) ⬆️
#dj20 87.96% <100%> (ø) ⬆️
#dj21 85.48% <100%> (ø) ⬆️
#dj22 83.37% <100%> (ø) ⬆️
#djmaster 81.38% <100%> (?)
#mysql_innodb 86.23% <100%> (ø) ⬆️
#mysql_myisam 86.07% <100%> (ø) ⬆️
#postgres 91.2% <100%> (ø) ⬆️
#py27 91.04% <100%> (ø) ⬆️
#py34 85.75% <100%> (ø) ⬆️
#py35 85.75% <100%> (ø) ⬆️
#py36 88.88% <100%> (+0.37%) ⬆️
#py37 85.86% <100%> (ø) ⬆️
#pytest41 85.21% <100%> (ø) ⬆️
#sqlite 90.39% <100%> (ø) ⬆️
#sqlite_file 85.75% <100%> (ø) ⬆️
#xdist 87.96% <100%> (ø) ⬆️
Impacted Files Coverage Δ
tests/conftest.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 787bbec...b03ea36. Read the comment docs.

@blueyed blueyed changed the title tests/conftest.py: move import of db_helpers Setup Django only later (pytest_configure) Apr 21, 2019
import django.apps
assert django.apps.apps.ready
from tpkg.app.models import Item
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's probably a dealbreaker: not being able to import models in your conftest at the toplevel anymore?!

@blueyed blueyed changed the title Setup Django only later (pytest_configure) [WIP/RFC] Setup Django only later (pytest_configure) Apr 21, 2019
@blueyed
Copy link
Contributor Author

blueyed commented Apr 21, 2019

Resorted to using a pytest plugin myself for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants