tests: fix hardcoded skip in test_import_from_url#3414
Open
Yashasm18 wants to merge 1 commit into
Open
Conversation
Replace skipif(True, ...) with a runtime check that detects whether tests are running inside a Docker container by checking for /.dockerenv. This allows the test to run normally outside containers while still skipping inside them where the temporary HTTP server is unreachable. Relates to moby/moby#52754 Signed-off-by: YASHAS <sssyashu850@gmail.com>
b8a1ed0 to
9026445
Compare
thaJeztah
reviewed
Jul 8, 2026
Comment on lines
-281
to
+285
| @pytest.mark.skipif(True, reason="Doesn't work inside a container - FIXME") | ||
| @pytest.mark.skipif( | ||
| os.environ.get('DOCKER_HOST', '').startswith('unix:///') and | ||
| os.path.exists('/.dockerenv'), | ||
| reason="Doesn't work inside a container - HTTP server unreachable from within Docker" |
Member
There was a problem hiding this comment.
I see this skip was originally added in 6c0f718
That PR added various similar skips ("Doesn't work inside a container - FIXME"), but a quick search shows that all of those skips were removed except for this one.
Do we know why this one doesn't work inside a container? And perhaps should we check if that's still the case, or if the Skip could be removed?
If it can't be removed, it would be good to leave a comment that describes why it doesn't work (so that potentially it could be fixed if it's not easy to fix short term)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace skipif(True, ...) with a runtime check that detects whether tests are running inside a Docker container by checking for /.dockerenv. This allows the test to run normally outside containers while still skipping inside them where the temporary HTTP server is unreachable.
Relates to moby/moby#52754