Skip to content

Include pytest version in the cached pyc tags#5484

Merged
nicoddemus merged 1 commit intopytest-dev:masterfrom
nicoddemus:pyc-version
Jun 25, 2019
Merged

Include pytest version in the cached pyc tags#5484
nicoddemus merged 1 commit intopytest-dev:masterfrom
nicoddemus:pyc-version

Conversation

@nicoddemus
Copy link
Member

All credits go to @asottile! Just wanted to make a small contribution before calling it a day.

Fix #1671


# pytest caches rewritten pycs in __pycache__.
PYTEST_TAG = "{}-PYTEST".format(sys.implementation.cache_tag)
PYTEST_TAG = "{}-pytest-{}".format(sys.implementation.cache_tag, version)
Copy link
Member Author

Choose a reason for hiding this comment

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

Decided to use lowercase pytest here because all the other tag elements are lower case. Decided to follow suit.

@codecov
Copy link

codecov bot commented Jun 24, 2019

Codecov Report

Merging #5484 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5484      +/-   ##
==========================================
+ Coverage   96.07%   96.07%   +<.01%     
==========================================
  Files         117      117              
  Lines       25538    25546       +8     
  Branches     2473     2473              
==========================================
+ Hits        24536    24544       +8     
  Misses        698      698              
  Partials      304      304
Impacted Files Coverage Δ
src/_pytest/assertion/rewrite.py 94.84% <100%> (+0.01%) ⬆️
testing/test_assertrewrite.py 84.2% <100%> (+0.16%) ⬆️

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 3f5b078...f43fb13. Read the comment docs.

@nicoddemus
Copy link
Member Author

Btw any concerns about the name of the file containing the dotted pytest version? For example foo.cpython-37-pytest-5.0.0.pyc?

I don't think it should be any problem, but thought I would ask.

@asottile
Copy link
Member

Seems fine to me!

@blueyed
Copy link
Contributor

blueyed commented Jun 25, 2019

foo.cpython-37-pytest-5.0.0.pyc

Likely should not really be a problem, but foo.cpython-37-pytest-50.pyc would be shorter and looks nicer / more like what Python does.

@asottile
Copy link
Member

Though dropping dots creates ambiguity between 5.1.10 and 5.11.0 🤷‍♂️

@nicoddemus
Copy link
Member Author

Though dropping dots creates ambiguity between 5.1.10 and 5.11.0

Had the same thought.

Well let's merge this then.

@nicoddemus nicoddemus merged commit 64a6365 into pytest-dev:master Jun 25, 2019
@nicoddemus nicoddemus deleted the pyc-version branch June 25, 2019 15:07
@asottile
Copy link
Member

pytest: drop the dot... only sometimes ;)

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.

assertion rewriting should be sensitive of the pytest version

3 participants