Skip to content

pytester: testdir: set $HOME to tmpdir#4941

Merged
blueyed merged 1 commit intopytest-dev:featuresfrom
blueyed:testdir-home
Mar 18, 2019
Merged

pytester: testdir: set $HOME to tmpdir#4941
blueyed merged 1 commit intopytest-dev:featuresfrom
blueyed:testdir-home

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented Mar 18, 2019

This avoids loading user configuration, which might interfere with test
results, e.g. a ~/.pdbrc.py with pdb++.

TODO:

  • changelog

@blueyed blueyed added type: enhancement new feature or API change, should be merged into features branch plugin: pytester related to the pytester builtin plugin labels Mar 18, 2019
@codecov
Copy link

codecov bot commented Mar 18, 2019

Codecov Report

Merging #4941 into features will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           features    #4941      +/-   ##
============================================
+ Coverage     95.84%   95.85%   +0.01%     
============================================
  Files           113      113              
  Lines         25266    25266              
  Branches       2495     2495              
============================================
+ Hits          24216    24219       +3     
+ Misses          735      734       -1     
+ Partials        315      313       -2
Impacted Files Coverage Δ
testing/test_pdb.py 99.09% <ø> (-0.01%) ⬇️
src/_pytest/pytester.py 90.69% <100%> (+0.02%) ⬆️
testing/test_junitxml.py 97.8% <100%> (-0.01%) ⬇️
src/_pytest/capture.py 93.7% <0%> (-0.45%) ⬇️
src/_pytest/terminal.py 91.8% <0%> (+0.81%) ⬆️

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 5d14362...c75dd10. Read the comment docs.

@blueyed
Copy link
Contributor Author

blueyed commented Mar 18, 2019

Pushed an update for @asottile (via https://bugs.python.org/issue36264) ;)
Does $USERPROFILE work like $HOME in this regard?

@asottile
Copy link
Member

Pushed an update for @asottile (via https://bugs.python.org/issue36264) ;)
Does $USERPROFILE work like $HOME in this regard?

yep

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

LGTM, missing only a CHANGELOG entry. 👍

@blueyed
Copy link
Contributor Author

blueyed commented Mar 18, 2019

Pushed an update for @asottile (via https://bugs.python.org/issue36264) ;)
Does $USERPROFILE work like $HOME in this regard?

yep

Might be worth having a helper in monkeypatch for this, handling any future changes in this regard maybe.. what do you think?

@asottile
Copy link
Member

Pushed an update for @asottile (via https://bugs.python.org/issue36264) ;)
Does $USERPROFILE work like $HOME in this regard?

yep

Might be worth having a helper in monkeypatch for this, handling any future changes in this regard maybe.. what do you think?

mayyyybe, seems pretty niche though

should this code do:

if sys.platform == 'nt':
    ...
else:
    ...

This avoids loading user configuration, which might interfere with test
results, e.g. a `~/.pdbrc.py` with pdb++.

Also sets USERPROFILE, which will be required with Python 3.8 [1].

1: https://bugs.python.org/issue36264
@blueyed
Copy link
Contributor Author

blueyed commented Mar 18, 2019

Yeah - basically it would help with what Python expects to see I guess; which also means that it should set $HOME with older versions (before 3.8), if it has preference there.

@blueyed blueyed dismissed nicoddemus’s stale review March 18, 2019 19:57

added changelog

@asottile
Copy link
Member

Yeah - basically it would help with what Python expects to see I guess; which also means that it should set $HOME with older versions (before 3.8), if it has preference there.

shrugs, I don't think we should add it (increase our maintenance surface area) until someone asks for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: pytester related to the pytester builtin plugin type: enhancement new feature or API change, should be merged into features branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants