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

Tests: Missing shutil import when used inside @unittest.skipIf condition #3317

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

echoix
Copy link
Member

@echoix echoix commented Dec 27, 2023

When trying to explore a bit more running unittest-based tests with pytest, discovering tests failed on this since shutils wasn’t imported in the file but used in the condition of @unittest.skipIf. Additionally found by a Python linter.

I don’t understand how the two test files could have run correctly and not fail yet with this missing import. Is it actually running in the test suite?

@echoix echoix added the Python Related code is in Python label Dec 27, 2023
@echoix echoix changed the title Missing shutil import when used as a @unittest.skipIf Missing shutil import when used inside @unittest.skipIf condition Dec 27, 2023
Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@nilason nilason added this to the 8.4.0 milestone Dec 28, 2023
@echoix echoix merged commit b5c4891 into OSGeo:main Dec 28, 2023
19 checks passed
@echoix echoix deleted the missing-import branch December 28, 2023 11:27
HuidaeCho pushed a commit to HuidaeCho/grass that referenced this pull request Jan 9, 2024
@wenzeslaus wenzeslaus changed the title Missing shutil import when used inside @unittest.skipIf condition Tests: Missing shutil import when used inside @unittest.skipIf condition Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants