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

#596 MarkInfo deprecation #603

Merged
merged 2 commits into from
May 30, 2018
Merged

#596 MarkInfo deprecation #603

merged 2 commits into from
May 30, 2018

Conversation

Code0x58
Copy link
Contributor

@Code0x58 Code0x58 commented May 29, 2018

Here is a quick go at removing the deprecation warning mentioned in #596 so tests won't break if running with -W error.

@@ -378,10 +378,10 @@ def _django_db_marker(request):
This will dynamically request the ``db`` or ``transactional_db``
fixtures as required by the django_db marker.
"""
marker = request.keywords.get('django_db', None)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The two places like this bump the requirements to pytest >= 3.6 - I think it would be easy enough to have code branch for pytest < 3.6 to maintain existing compatibility if that feels like a blocker to this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I think requiring pytest 3.6 is fine.

if marker:
validate_django_db(marker)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% happy with the naming, but I didn't think of anything better.

Copy link
Contributor

Choose a reason for hiding this comment

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

What naming do you mean?
marker here, or transaction below?
As for transaction it could be named transactional mabye?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking validate_django_db(…) as it gets a value, and may happen to blow up, but it feels more ok to me now

@@ -11,6 +11,7 @@ _build
/.coverage
/htmlcov/
.cache
.pytest_cache/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was missing, so added it in a separate commit.

@codecov-io
Copy link

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #603   +/-   ##
=======================================
  Coverage   91.92%   91.92%           
=======================================
  Files          33       33           
  Lines        1660     1660           
  Branches      143      143           
=======================================
  Hits         1526     1526           
  Misses         95       95           
  Partials       39       39
Flag Coverage Δ
#dj110 83.91% <100%> (ø) ⬆️
#dj111 86.08% <100%> (ø) ⬆️
#dj18 84.75% <100%> (ø) ⬆️
#dj19 83.79% <100%> (ø) ⬆️
#dj20 84.21% <100%> (ø) ⬆️
#djmaster 84.21% <100%> (ø) ⬆️
#mysql_innodb 84.21% <100%> (ø) ⬆️
#mysql_myisam 84.15% <100%> (ø) ⬆️
#postgres 87.59% <100%> (ø) ⬆️
#py27 89.21% <100%> (ø) ⬆️
#py34 83.79% <100%> (ø) ⬆️
#py35 83.91% <100%> (ø) ⬆️
#py36 84.69% <100%> (ø) ⬆️
#sqlite 85.96% <100%> (ø) ⬆️
#sqlite_file 83.79% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pytest_django/plugin.py 85.75% <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 8bd3d3e...d9a9e9a. Read the comment docs.

@blueyed blueyed merged commit d9a9e9a into pytest-dev:master May 30, 2018
@blueyed
Copy link
Contributor

blueyed commented May 30, 2018

Merged with changelog entry in 8d548e7.
Thanks!

@blueyed
Copy link
Contributor

blueyed commented May 30, 2018

Don't you see other errors then btw?

Tried it changing the commands for the testenv:

py36-dj20-postgres runtests: commands[0] | python -W error -m pytest --strict -x
Failed to import the site module
Traceback (most recent call last):
  File "…/Vcs/pytest-django/.tox/py36-dj20-postgres/lib/python3.6/site.py", line 703, in <module>
    main()
  File "…/Vcs/pytest-django/.tox/py36-dj20-postgres/lib/python3.6/site.py", line 683, in main
    paths_in_sys = addsitepackages(paths_in_sys)
  File "…/Vcs/pytest-django/.tox/py36-dj20-postgres/lib/python3.6/site.py", line 282, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "…/Vcs/pytest-django/.tox/py36-dj20-postgres/lib/python3.6/site.py", line 204, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "…/Vcs/pytest-django/.tox/py36-dj20-postgres/lib/python3.6/site.py", line 165, in addpackage
    f = open(fullname, "rU")
DeprecationWarning: 'U' mode is deprecated

Looks like this one is coming from Python (3.6.5) itself?!
Fixed for 3.7 in python/cpython@4e86d5b88d9.

@Code0x58
Copy link
Contributor Author

I didn't encounter that in the environment I was in. It is strange that the patch is 7 years old - it is included in at least the 3.4+ branches on GitHub, but not 2.7, so I think something is up with the environment like 2.7 files are being used.

@nirizr
Copy link

nirizr commented Jun 16, 2018

Hi guys, just an FYI; This PR turned out to be breaking my builds, as it replaces the pytest required version from (the documented, still in README.md) 2.9 up to 3.6.
I wasn't sure this was intended as it isn't noted in either the PR or commit messages, so thought I'd note it here.

@blueyed
Copy link
Contributor

blueyed commented Jun 16, 2018

@nirizr
Thanks for the notification, I will update the README.

See #603 (comment) - we/I've decided that it's OK to bump it, that's also why it became 3.3.0.
It is also in the release note's title on Github: https://github.com/pytest-dev/pytest-django/releases/tag/3.3.0.

blueyed added a commit that referenced this pull request Jun 16, 2018
beyondgeeks added a commit to beyondgeeks/django-pytest that referenced this pull request Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants