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)

@blueyed
Copy link
Contributor Author

blueyed commented Feb 13, 2019

@RonnyPfannschmidt
Copy link
Member

did this practically happen?

@blueyed
Copy link
Contributor Author

blueyed commented Feb 13, 2019

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

@RonnyPfannschmidt
Copy link
Member

Yikes, thanks

@blueyed blueyed force-pushed the py34-fspath-filenotfound branch from 3b86205 to 1a5f9b9 Compare February 14, 2019 18:13
@blueyed
Copy link
Contributor Author

blueyed commented Feb 14, 2019

Rebased.

@blueyed
Copy link
Contributor Author

blueyed commented Feb 14, 2019

Pushed a fixup.

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

@nicoddemus
Copy link
Member

Can you please check the travis failure @blueyed?

@blueyed
Copy link
Contributor Author

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 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

Any clues about the failures on Travis?

@blueyed
Copy link
Contributor Author

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

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 Compare February 22, 2019 04:42
@blueyed blueyed force-pushed the py34-fspath-filenotfound branch from 74e8a71 to d714f41 Compare March 1, 2019 21:19
blueyed added 2 commits April 5, 2019 15:42
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 Compare April 5, 2019 13:42
@blueyed
Copy link
Contributor Author

blueyed commented Apr 5, 2019

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

@codecov-io
Copy link

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

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

@blueyed
Copy link
Contributor Author

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
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