Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar committed Aug 8, 2024
1 parent 82f120d commit ff12c0c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ jobs:
# package setup
- uses: actions/checkout@v4

- name: Install package and dependencies
run: |
if [ "${MATRIX_ENV_MINIMAL}" = "false" ]; then
pip install .[dev,marisa-trie]
else
pip install .[dev]
fi
- name: Install dependencies
run: python -m pip install ".[dev]"

- name: Install full dependencies
if: ${{ matrix.env.MINIMAL == 'false'}}
run: python -m pip install --ignore-installed ".[marisa-trie]"

# tests
- name: Lint with flake8
Expand All @@ -83,7 +82,7 @@ jobs:

# coverage with default version
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
if: ${{ matrix.env.MINIMAL == 'false' && matrix.python-version == '3.11' }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
12 changes: 11 additions & 1 deletion tests/strategies/dictionaries/test_trie_dictionary_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
from unittest.mock import call, patch

import pytest
from marisa_trie import BytesTrie # type: ignore[import-not-found]

try:
from marisa_trie import BytesTrie # type: ignore[import-not-found]

HAS_MARISA = True
except ImportError:
HAS_MARISA = False

from simplemma.strategies.dictionaries.trie_directory_factory import TrieWrapDict
from simplemma.strategies import TrieDictionaryFactory


if not HAS_MARISA:
pytest.skip("skipping marisa-trie tests", allow_module_level=True)


def test_exceptions() -> None:
# missing languages or faulty language codes
dictionary_factory = TrieDictionaryFactory(use_disk_cache=False)
Expand Down

0 comments on commit ff12c0c

Please sign in to comment.