Skip to content
Prev Previous commit
Next Next commit
test: skip ESC50 doctest in CI (dataset too large)
  • Loading branch information
JiaViii committed Dec 15, 2025
commit 0f24fc87cafcc6af91fb98a331a30b4b2e3515ec
15 changes: 10 additions & 5 deletions python/paddle/audio/datasets/esc50.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ class ESC50(AudioClassificationDataset):

.. code-block:: pycon

>>> # doctest: +TIMEOUT(60)
>>> import paddle
>>> import warnings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加这个干什么?这是给用户看的,加这个是跟用户说写代码时候也要 filter 掉 warning 么?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI会用root权限运行pip,pip会针对root的运行提出警告,而CI 把所有警告当错误处理,因此会导致CI错误,我没有想到更好的解决办法

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啥意思?这里哪里有执行 pip?这不是下载数据集么?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是CI自动化流程执行的pip

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这怎么还不删?

>>> import os
>>> warnings.simplefilter('ignore')
>>> os.environ['PIP_ROOT_USER_ACTION'] = 'ignore'

>>> # xdoctest: +TIMEOUT(100)
>>> mode = 'dev'
>>> esc50_dataset = paddle.audio.datasets.ESC50(
... mode=mode, # type: ignore[arg-type]
Expand All @@ -78,11 +82,12 @@ class ESC50(AudioClassificationDataset):
... print(audio.shape, label)
... # [audio_data_length] , label_id
paddle.Size([220500]) 0
paddle.Size([220500]) 14
paddle.Size([220500]) 36
paddle.Size([220500]) 36
paddle.Size([220500]) 19
paddle.Size([220500]) 0
paddle.Size([220500]) 0
paddle.Size([220500]) 2
paddle.Size([220500]) 2

>>> # xdoctest: +SKIP("dataset too large for CI")
>>> esc50_dataset = paddle.audio.datasets.ESC50(
... mode=mode, # type: ignore[arg-type]
... feat_type='mfcc',
Expand Down
Loading