ci: Use a custom httpbin instance in tests#167
Merged
Conversation
Collaborator
janbuchar
commented
Jun 3, 2024
- closes Run httpbin locally instead of using httpbin.org #160
This was referenced Jun 3, 2024
janbuchar
added a commit
that referenced
this pull request
Jun 3, 2024
This is the non-controversial part of #167.
Collaborator
|
I believe we can convert this to a draft for now? |
vdusek
approved these changes
Nov 18, 2024
Collaborator
vdusek
left a comment
There was a problem hiding this comment.
Thanks for finishing this!
I have just one nit pick regarding the string conversion, and one suggestion for further improvement (maybe even a bug fix). But let's do it in a separate PR as it is not ci-related.
| pass | ||
|
|
||
| await crawler.run(['https://example.com', 'https://httpbin.org']) | ||
| await crawler.run(['https://example.com', f'{httpbin}']) |
Collaborator
There was a problem hiding this comment.
Couldn't we use just str(httpbin)?
| async def test_open_and_close_page(controller: PlaywrightBrowserController, httpbin: str) -> None: | ||
| async def test_open_and_close_page(controller: PlaywrightBrowserController, httpbin: URL) -> None: | ||
| page = await controller.new_page() | ||
| await page.goto(f'{httpbin}') |
Collaborator
There was a problem hiding this comment.
could you please update it here to only str(httpbin) as well?
Comment on lines
+130
to
+134
| if ( | ||
| context.session | ||
| and status_code not in self._http_client._ignore_http_error_status_codes # noqa: SLF001 | ||
| and context.session.is_blocked_status_code(status_code=status_code) | ||
| ): |
Collaborator
There was a problem hiding this comment.
Wondering whether this part should not look more like this:
if context.session and context.session.is_blocked_status_code(
status_code=status_code,
additional_blocked_status_codes=self._http_client.additional_blocked_status_codes,
ignore_http_error_status_codes=self._http_client.ignore_http_error_status_codes
):which would require further changes as well, but since you're touching it here, I'm mentioning it ... Maybe do it in other PR. If I am not overlooking anything.
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.