Added additional unit tests#19
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds additional unit tests for URL constructor behavior and modifies the URL handling code to ensure consistent escape sequence cleanup across multi-argument construction patterns.
Key Changes
- Enhanced URL constructor to handle multi-argument scenarios consistently across Python versions
- Improved escape sequence cleanup to handle multiple encoding formats
- Added comprehensive unit tests for constructor canonicalization and multi-argument joining
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| urlpath/_utils.py | Enhanced cleanup_escapes function to handle multiple escape sequence formats |
| urlpath/_url.py | Refactored URL constructor logic and improved escape cleanup in _combine_args method |
| tests/test_url.py | Added new unit tests for constructor canonicalization and multi-argument semantics, removed webob conditional imports |
| import webob | ||
| except ImportError: | ||
| webob = None | ||
| import webob |
There was a problem hiding this comment.
Importing webob unconditionally but the tests previously had conditional import logic. This will cause test failures when webob is not installed, breaking the optional dependency pattern.
| import webob | |
| try: | |
| import webob | |
| HAS_WEBOB = True | |
| except ImportError: | |
| HAS_WEBOB = False |
|
|
||
|
|
||
| @pytest.mark.skipif(webob is None, reason="webob not installed") | ||
| def test_webob() -> None: |
There was a problem hiding this comment.
Removed @pytest.mark.skipif decorators for webob tests but kept unconditional webob import. These tests will fail when webob is not installed, as the skipif decorators were essential for optional dependency handling.
|
|
||
|
|
||
| @pytest.mark.skipif(webob is None, reason="webob not installed") | ||
| def test_webob_jail() -> None: |
There was a problem hiding this comment.
Removed @pytest.mark.skipif decorators for webob tests but kept unconditional webob import. These tests will fail when webob is not installed, as the skipif decorators were essential for optional dependency handling.
No description provided.