Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Nov 10, 2023
1 parent 9a08ff5 commit f7dd52a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
from pathlib import Path
from unittest.mock import MagicMock

import pytest
from _pytest._py.path import LocalPath
Expand All @@ -15,7 +14,6 @@ def setup_logging():
logging.root.handlers = []
logging.basicConfig(level='INFO')
logging.getLogger('tests').setLevel('DEBUG')
# logging.getLogger('sciencebeam_trainer_delft').setLevel('DEBUG')


@pytest.fixture
Expand Down
9 changes: 5 additions & 4 deletions tests/test_supermat_tei_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from src.supermat.supermat_tei_parser import get_children_list_grouped, get_sentences_nodes, get_paragraphs_nodes



def test_get_sentences_nodes_input_with_sentences_grouped():
soup = BeautifulSoup(open(os.path.join("test_data", 'test_sentences.xml')), 'xml')
soup = BeautifulSoup(open(os.path.join(os.path.dirname(__file__), "test_data", 'test_sentences.xml')), 'xml')

children = get_sentences_nodes(soup, grouped=True)

Expand All @@ -19,7 +20,7 @@ def test_get_sentences_nodes_input_with_sentences_grouped():


def test_get_sentences_nodes_input_with_sentences_flatten():
soup = BeautifulSoup(open(os.path.join("test_data", 'test_sentences.xml')), 'xml')
soup = BeautifulSoup(open(os.path.join(os.path.dirname(__file__), "test_data", 'test_sentences.xml')), 'xml')

children = get_sentences_nodes(soup, grouped=False)

Expand All @@ -28,7 +29,7 @@ def test_get_sentences_nodes_input_with_sentences_flatten():


def test_get_paragraph_nodes_input_with_paragraphs():
soup = BeautifulSoup(open(os.path.join("test_data", 'test_paragraphs.xml')), 'xml')
soup = BeautifulSoup(open(os.path.join(os.path.dirname(__file__), "test_data", 'test_paragraphs.xml')), 'xml')

children = get_paragraphs_nodes(soup)

Expand All @@ -37,7 +38,7 @@ def test_get_paragraph_nodes_input_with_paragraphs():


def test_get_children_sentences_input_with_paragraphs():
soup = BeautifulSoup(open(os.path.join("test_data", 'test_sentences.xml')), 'xml')
soup = BeautifulSoup(open(os.path.join(os.path.dirname(__file__), "test_data", 'test_sentences.xml')), 'xml')

children = get_children_list_grouped(soup, use_paragraphs=False)

Expand Down

0 comments on commit f7dd52a

Please sign in to comment.