-
Notifications
You must be signed in to change notification settings - Fork 345
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
Implement the --django-debug plugin option with tests #463
Conversation
fwiw, starting from django 1.11 (to be released in april), django's test runner will have that option: https://docs.djangoproject.com/en/dev/ref/django-admin/#cmdoption-test-debug-mode |
@karyon It gets passed through to pytest-django/pytest_django/plugin.py Line 340 in b3d7fd6
@dulaccc |
Sure, I will try to update that soon! |
is this going out of radar? |
@dulaccc |
Codecov Report
@@ Coverage Diff @@
## master #463 +/- ##
==========================================
+ Coverage 97.9% 98.08% +0.18%
==========================================
Files 32 32
Lines 1863 1883 +20
Branches 147 149 +2
==========================================
+ Hits 1824 1847 +23
+ Misses 26 24 -2
+ Partials 13 12 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use new API wiith Django 1.11+ (see above).
38a959e
to
936931c
Compare
I fixed the PR with the Django 1.11 new Is that okay for you? Cheers |
fyi, the tests failed :) |
936931c
to
c113970
Compare
sorry, i'm not a maintainer of pytest-django, i just saw that the tests failed and thought i let you know because i myself often don't notice that :) |
Oh, alright. Thanks for the heads-up @karyon! :) |
Tests are failing with pytest 3.3 (and the other jobs are using an older version (cache likely?!)) |
Please rebase, since our tests in master were failing with pytest 3.3. |
c113970
to
297bf97
Compare
@blueyed nice catch for the pytest version and the caching issue! |
@blueyed can you merge this before master diverge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrased the doc a bit - please review.
Left some other comments.
@dulacp This issue took a solid 45 minutes to track it down - I guess a lot of other developers would have faced the same issue. It would be great if you could get this committed. |
Just wasted 30 minutes of my life due to this. Would be great to get this merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rebase
@samueldotj @richardARPANET Also it clearly cannot be "just merged" given 4 conflicting files. |
@blueyed My application was configured by env vars. One for the DEBUG setting.
It worked at run-time, but not at test run-time. Which let to me trying/checking all sorts of things, I didn't expect pytest-django to be overriding this setting at all. |
I see. @pytest.fixture(scope="session", autouse=True)
def dj_debug(settings):
settings.DEBUG = True (or per test) Django itself has |
a new option --debug-mode has been introduced, so let's name ours --django-debug-mode
10c8aba
to
5b4baa1
Compare
@dulacp I've pushed a fixup commit, let me know if this looks good to you, and we can finally (squash-)merge this then. |
Thanks for the fixup commit! It looks great :) |
Great. Just wondered about the name - it mentions |
I think we should use |
I've made the changes to use Cheers |
@blueyed Should the master branch be merged to incorporate some new tests and pytest 5.4.0 or is this good to go? |
Oops, I was not aware of this PR and added a similar solution in #888. Only I used an ini option and called it |
Follows the #228 issue, and the un-merged #231 PR.
I've taken into account @blueyed comment, and included a comprehensive list of tests.
Cheers