File: test_special_characters.py

package info (click to toggle)
python-playsound3 3.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 880 kB
  • sloc: python: 540; sh: 10; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 609 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import time

from playsound3 import AVAILABLE_BACKENDS, playsound

wav = "tests/sounds/звук 音 聲音.wav"


def test_with_blocking():
    for backend in AVAILABLE_BACKENDS:
        print(f"Testing backend: {backend}")

        sound = playsound(wav, block=True, backend=backend)
        assert not sound.is_alive()


def test_non_blocking():
    for backend in AVAILABLE_BACKENDS:
        print(f"Testing backend: {backend}")

        sound = playsound(wav, block=False, backend=backend)
        time.sleep(0.05)
        assert sound.is_alive()

        sound.wait()
        assert not sound.is_alive()