You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Two playlist tests are currently failing in the nixpkgs tests (ignore the cipher tests, I opened a second PR to fix those) as they require DNS to resolve which fails in a sandboxed environment (such as the nix build environment).
Since all other tests pass just fine and there's mocking in place I figure that these tests specifically are doing some additional requests which somehow bypass the mocking, which would mean that a) tests suites may currently cause requests against the live YouTube API which may have adverse effects on people running the test suite locally (like being treated as bots by YouTube and being unable to watch without an account like many others) and b) the tests may not be pure and fail depending on upstream changes which runs counter to the intention of those tests.
code that was used that resulted in the bug
The logs above contain a full trace, however it seems that the pagination bypasses the mock:
FAILED tests/contrib/test_playlist.py::test_playlist_failed_pagination - urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name ...
FAILED tests/contrib/test_playlist.py::test_playlist_pagination - urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name ...
Expected behavior
Tests should pass even when DNS resolution is not available.
Tests should not make requests to the YouTube API.
Desktop (please complete the following information):
OS: NixOS unstable
Python Version: 3.11.10
Pytubefix Version: main
Additional context
I'd proceed to disable those tests downstream for now, and it's not terribly important, so this is more of a nice to have, and if those tests are made to work without DNS I'd be happy to enable them again.
The text was updated successfully, but these errors were encountered:
Describe the bug
Two playlist tests are currently failing in the nixpkgs tests (ignore the cipher tests, I opened a second PR to fix those) as they require DNS to resolve which fails in a sandboxed environment (such as the nix build environment).
Since all other tests pass just fine and there's mocking in place I figure that these tests specifically are doing some additional requests which somehow bypass the mocking, which would mean that a) tests suites may currently cause requests against the live YouTube API which may have adverse effects on people running the test suite locally (like being treated as bots by YouTube and being unable to watch without an account like many others) and b) the tests may not be pure and fail depending on upstream changes which runs counter to the intention of those tests.
code that was used that resulted in the bug
The logs above contain a full trace, however it seems that the pagination bypasses the mock:
pytubefix/pytubefix/contrib/playlist.py
Lines 325 to 327 in 5303b64
And is triggered in these two tests:
Expected behavior
Tests should pass even when DNS resolution is not available.
Tests should not make requests to the YouTube API.
Desktop (please complete the following information):
Additional context
I'd proceed to disable those tests downstream for now, and it's not terribly important, so this is more of a nice to have, and if those tests are made to work without DNS I'd be happy to enable them again.
The text was updated successfully, but these errors were encountered: