Skip to content

Conversation

@jchristgit
Copy link

@jchristgit jchristgit commented Oct 15, 2017

As suggested in #331, this PR makes tox output a friendlier exception when setup.py could not be found. When this is the case, the following is outputted instead of throwing a MissingFile exception:

tox output missing setup.py

Checklist:

  • wrote descriptive pull request text
  • added/updated test(s)
  • updated/extended the documentation
    Should this be documented and if yes, where?
  • added relevant issue keyword
    in message body
  • added news fragment in changelog folder, see this
  • added yourself to CONTRIBUTORS (preserving alphabetical order)
@codecov
Copy link

codecov bot commented Oct 15, 2017

Codecov Report

Merging #650 into master will decrease coverage by 3.12%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #650 +/- ## ========================================== - Coverage 93.86% 90.73% -3.13%  ========================================== Files 11 11 Lines 2364 2365 +1 Branches 0 395 +395 ========================================== - Hits 2219 2146 -73  + Misses 145 144 -1  - Partials 0 75 +75
Impacted Files Coverage Δ
tox/session.py 91.98% <100%> (-2.36%) ⬇️
tox/_verlib.py 71.57% <0%> (-9.48%) ⬇️
tox/_quickstart.py 77.62% <0%> (-5.6%) ⬇️
tox/interpreters.py 77.34% <0%> (-4.69%) ⬇️
tox/_pytestplugin.py 89.95% <0%> (-4.02%) ⬇️
tox/config.py 95.03% <0%> (-2.55%) ⬇️
tox/venv.py 93.76% <0%> (-2.5%) ⬇️

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 5cf2ef9...f645111. Read the comment docs.

@asottile
Copy link
Contributor

Here's the answer to "why does it exit 0": https://github.com/Volcyy/tox/blob/d5a68ad9b6313d9505f9ecfdcd32556e040d4e20/tox/_pytestplugin.py#L309

initproj sets up a setup.py by default, you'll probably need to explicitly delete it in your test to demonstrate the behaviour

@jchristgit
Copy link
Author

Thanks for telling me that, I added the test case, it removes the file now. There seems to be some issue with one of the Travis builds though, and I'm not sure how to fix that.

@asottile
Copy link
Contributor

asottile commented Nov 9, 2017

I nudged travis-ci for ya :)

This looks good to me, curious to hear one of the more seasoned maintainers chime in on whether we're ok with switching the exception here.

@gaborbernat gaborbernat self-requested a review November 11, 2017 17:21
@gaborbernat gaborbernat merged commit aa71b8e into tox-dev:master Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants