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

path.common: handle FileNotFoundError when trying to import pathlib #207

Merged
merged 3 commits into from Apr 5, 2019

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented Feb 13, 2019

Python 3.4 might raise FileNotFoundError due to os.getcwd() failing on
a non-existing cwd. This is fixed in Python 3.5.

Ref: pytest-dev/pytest#4787 (comment)

@RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Feb 13, 2019

did this practically happen?

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Feb 13, 2019

Yes, with py34-xdist on Travis, see the original ref.

@RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Feb 14, 2019

Yikes, thanks

@blueyed blueyed force-pushed the py34-fspath-filenotfound branch from 3b86205 to 1a5f9b9 Feb 14, 2019
@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Feb 14, 2019

Rebased.

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Feb 14, 2019

Pushed a fixup.

I also wonder if caching the ImportError wouldn't make sense?!

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Feb 18, 2019

Can you please check the travis failure @blueyed?

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Feb 18, 2019

I think it is related to pytest itself failing with the test.
Will have to investigate.

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Feb 18, 2019

IIRC AppVeyor skips the test.

testing/path/test_local.py Outdated Show resolved Hide resolved
testing/path/test_local.py Show resolved Hide resolved
@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Feb 22, 2019

Any clues about the failures on Travis?

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Feb 22, 2019

Still the same as with #207 (comment) I guess.
No energy to look into this now.

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Feb 22, 2019

OK. Another option is to drop support for those old pytest versions.

With the "importlib" option getting used in pytest, we will need to require a higher version of py anyway.

@blueyed blueyed force-pushed the py34-fspath-filenotfound branch from 820aa08 to 74e8a71 Feb 22, 2019
@blueyed blueyed force-pushed the py34-fspath-filenotfound branch from 74e8a71 to d714f41 Mar 1, 2019
blueyed added 2 commits Apr 5, 2019
Python 3.4 might raise FileNotFoundError due to `os.getcwd()` failing on
a non-existing cwd.  This is fixed in Python 3.5.

Ref: pytest-dev/pytest#4787 (comment)
Might not really be necessary, since py27 triggers the ImportError
always already, but better to be safe.
@blueyed blueyed force-pushed the py34-fspath-filenotfound branch from d714f41 to a64cb3f Apr 5, 2019
@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Apr 5, 2019

Fixed the new test to cd back (using monkeypatch).

@codecov-io
Copy link

@codecov-io codecov-io commented Apr 5, 2019

Codecov Report

Merging #207 into master will increase coverage by 0.03%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   82.04%   82.07%   +0.03%     
==========================================
  Files          55       55              
  Lines       10136    10153      +17     
  Branches     1141     1141              
==========================================
+ Hits         8316     8333      +17     
  Misses       1556     1556              
  Partials      264      264

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Apr 5, 2019

Please add a CHANGELOG then it is good to go I think

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Apr 5, 2019

Pushed with [ci skip] - hopefully that will still trigger it on the merge.

@nicoddemus nicoddemus merged commit 2802b18 into pytest-dev:master Apr 5, 2019
@blueyed blueyed deleted the py34-fspath-filenotfound branch Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants