Skip to content

Fix "ValueError: Plugin already registered" exceptions when running in build directories that symlink to actual source.#4738

Merged
nicoddemus merged 2 commits into
pytest-dev:masterfrom
pstradomski:master
Feb 8, 2019
Merged

Fix "ValueError: Plugin already registered" exceptions when running in build directories that symlink to actual source.#4738
nicoddemus merged 2 commits into
pytest-dev:masterfrom
pstradomski:master

Conversation

@pstradomski

Copy link
Copy Markdown
Contributor

Some build systems (e.g. bazel) create build directories that have original source files symlinked and not copied or hardlinked.

This confused pytest which tried to refer to a conftest file by realpath in some cases and with symlink path in others, leading to "ValueError: Plugin already registered" exception. This PR fixes that.

…n build directories that symlink to actual source.
Comment thread src/_pytest/config/__init__.py
@codecov

codecov Bot commented Feb 7, 2019

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4738      +/-   ##
==========================================
+ Coverage   95.67%   95.67%   +<.01%     
==========================================
  Files         113      113              
  Lines       24968    24980      +12     
  Branches     2479     2481       +2     
==========================================
+ Hits        23887    23899      +12     
  Misses        762      762              
  Partials      319      319
Flag Coverage Δ
#docs 29.67% <7.69%> (+0.08%) ⬆️
#doctesting 29.67% <7.69%> (+0.08%) ⬆️
#linting 29.67% <7.69%> (+0.08%) ⬆️
#linux 95.5% <100%> (ø) ⬆️
#nobyte 92.29% <100%> (+0.63%) ⬆️
#numpy 93.06% <15.38%> (+50.97%) ⬆️
#pexpect 42.06% <7.69%> (-0.03%) ⬇️
#py27 93.69% <100%> (ø) ⬆️
#py34 91.77% <100%> (+0.19%) ⬆️
#py35 91.77% <100%> (+0.19%) ⬆️
#py36 91.79% <100%> (+0.23%) ⬆️
#py37 93.8% <100%> (ø) ⬆️
#trial 93.06% <15.38%> (+50.97%) ⬆️
#windows 93.82% <15.38%> (+0.51%) ⬆️
#xdist 93.71% <100%> (ø) ⬆️
Impacted Files Coverage Δ
src/_pytest/config/__init__.py 93.67% <100%> (ø) ⬆️
testing/test_conftest.py 99.62% <100%> (+0.01%) ⬆️

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 2f08350...59e6fb9. Read the comment docs.

@codecov

codecov Bot commented Feb 7, 2019

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4738      +/-   ##
==========================================
+ Coverage   95.67%   95.67%   +<.01%     
==========================================
  Files         113      113              
  Lines       24968    24980      +12     
  Branches     2479     2481       +2     
==========================================
+ Hits        23887    23899      +12     
  Misses        762      762              
  Partials      319      319
Flag Coverage Δ
#docs 29.67% <7.69%> (+0.08%) ⬆️
#doctesting 29.67% <7.69%> (+0.08%) ⬆️
#linting 29.67% <7.69%> (+0.08%) ⬆️
#linux 95.5% <100%> (ø) ⬆️
#nobyte 92.29% <100%> (+0.63%) ⬆️
#numpy 93.06% <15.38%> (+50.97%) ⬆️
#pexpect 42.06% <7.69%> (-0.03%) ⬇️
#py27 93.69% <100%> (ø) ⬆️
#py34 91.77% <100%> (+0.19%) ⬆️
#py35 91.77% <100%> (+0.19%) ⬆️
#py36 91.79% <100%> (+0.23%) ⬆️
#py37 93.8% <100%> (ø) ⬆️
#trial 93.06% <15.38%> (+50.97%) ⬆️
#windows 93.82% <15.38%> (+0.51%) ⬆️
#xdist 93.71% <100%> (ø) ⬆️
Impacted Files Coverage Δ
src/_pytest/config/__init__.py 93.67% <100%> (ø) ⬆️
testing/test_conftest.py 99.62% <100%> (+0.01%) ⬆️

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 2f08350...391dc54. Read the comment docs.

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

well done, thanks

@nicoddemus nicoddemus merged commit 32c6d4f into pytest-dev:master Feb 8, 2019
@pstradomski

pstradomski commented Feb 9, 2019 via email

Copy link
Copy Markdown
Contributor Author

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.

4 participants