Datasets:

Modalities:
Audio
Text
Formats:
parquet
Size:
< 1K
ArXiv:
DOI:
Libraries:
Datasets
pandas
jam-alt / tests /conftest.py
cifkao's picture
Add tests
70954e8
raw
history blame
658 Bytes
from pathlib import Path
import pytest
@pytest.fixture()
def lyrics_files():
return [f for f in Path("lyrics").glob("*.txt")]
@pytest.fixture()
def lyrics(lyrics_files):
lyrics = []
for lyric_file in lyrics_files:
with open(lyric_file, "r", encoding="utf-8") as file:
lyrics.append((file.read(), str(lyric_file.name)))
return lyrics
@pytest.fixture()
def lines(lyrics):
all_lines = []
for lyric in lyrics:
line_number = 0
lines = lyric[0].splitlines()
for line in lines:
line_number += 1
all_lines.append((line, line_number, lyric[1]))
return all_lines