Skip to content

🚑 Fix test_should_build#2193

Merged
opacam merged 1 commit intokivy:developfrom
opacam:hotfix-python3-test-should-build
May 13, 2020
Merged

🚑 Fix test_should_build#2193
opacam merged 1 commit intokivy:developfrom
opacam:hotfix-python3-test-should-build

Conversation

@opacam
Copy link
Member

@opacam opacam commented May 13, 2020

Because, I forgot to implement it when I first wrote the test at 535b39d

Note: I replaced os.path.isfile by pathlib.Path(<any-path>).is_file() because:

  • It seems that when trying to mock isfile function, doesn't work as expected (is completely ignored, unless we import the whole os.path module)
  • Given the above situation, we must modify the import, so better use the pathlib implementation, wich it has several advantages (it handles any kind of path automatically, no matter the platform)

Because, I forgot to implement it when I first wrote the test at 535b39d

**Note:** I replaced `os.path.isfile` by `pathlib.Path(<any-path>).is_file()` because:
  - It seems that when trying to mock `isfile` function, doesn't work as expected (is completely ignored, unless we import the whole `os.path` module)
  - Given the above situation, we must modify the import, so better use the `pathlib` implementation, wich it has several advantages (it handles any kind of path automatically, no matter the platform)
@opacam opacam requested a review from AndreMiras May 13, 2020 10:10
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@opacam opacam merged commit eb11081 into kivy:develop May 13, 2020
@opacam opacam deleted the hotfix-python3-test-should-build branch May 13, 2020 12:08
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.

2 participants