diff --git a/.github/workflows/coverage-pr.yml b/.github/workflows/coverage-pr.yml deleted file mode 100644 index d248b8f..0000000 --- a/.github/workflows/coverage-pr.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Code coverage - -on: - pull_request_target: - paths: - - ytmusicapi/** - - tests/** - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: 3.x - - name: Setup PDM - uses: pdm-project/setup-pdm@v4 - - name: create-json - uses: jsdaniell/create-json@v1.2.3 - with: - name: "oauth.json" - dir: "tests/" - json: ${{ secrets.OAUTH_JSON }} - - name: Install dependencies - run: pdm install - - name: Generate coverage report - env: - HEADERS_AUTH: ${{ secrets.HEADERS_AUTH }} - TEST_CFG: ${{ secrets.TEST_CFG }} - run: | - curl -o tests/test.mp3 https://www.kozco.com/tech/piano2-CoolEdit.mp3 - cat <<< "$HEADERS_AUTH" > tests/browser.json - cat <<< "$TEST_CFG" > tests/test.cfg - (echo "===== tests attempt: 1 ====" && pdm run pytest) || \ - (echo "===== tests attempt: 2 ====" && pdm run pytest) - pdm run coverage xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - file: coverage.xml - flags: unittests - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/tests/mixins/test_browsing.py b/tests/mixins/test_browsing.py index f798e26..01f4a3c 100644 --- a/tests/mixins/test_browsing.py +++ b/tests/mixins/test_browsing.py @@ -84,7 +84,7 @@ class TestBrowsing: album = yt.get_album("MPREabc") assert len(album["tracks"]) == 19 assert len(album["artists"]) == 1 - assert len(album) == 13 + assert len(album) == 14 def test_get_album(self, yt, yt_auth, sample_album): album = yt_auth.get_album(sample_album) diff --git a/tests/mixins/test_search.py b/tests/mixins/test_search.py index 45c2b50..2d348d6 100644 --- a/tests/mixins/test_search.py +++ b/tests/mixins/test_search.py @@ -77,7 +77,7 @@ class TestSearch: assert len(results) > 10 assert all(item["resultType"] == "podcast" for item in results) results = yt_auth.search(query, filter="episodes") - assert len(results) > 10 + assert len(results) > 5 assert all(item["resultType"] == "episode" for item in results) def test_search_top_result(self, yt): diff --git a/ytmusicapi/mixins/browsing.py b/ytmusicapi/mixins/browsing.py index 1ae88d2..c7490dd 100644 --- a/ytmusicapi/mixins/browsing.py +++ b/ytmusicapi/mixins/browsing.py @@ -521,7 +521,7 @@ class BrowsingMixin(MixinProtocol): album["tracks"] = parse_playlist_items(results["contents"], is_album=True) other_versions = nav( - response, [*TWO_COLUMN_RENDERER, "secondaryContents", *SECTION_LIST, 1, *CAROUSEL] + response, [*TWO_COLUMN_RENDERER, "secondaryContents", *SECTION_LIST, 1, *CAROUSEL], True ) if other_versions is not None: album["other_versions"] = parse_content_list(other_versions["contents"], parse_album)