Skip to content

Commit

Permalink
fix(test): no longer require flask needlessly for some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Mar 26, 2024
1 parent 7297f5a commit db12326
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions g2p/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

import jsonschema
import yaml
from click.testing import CliRunner
from tqdm import tqdm

from g2p._version import VERSION
from g2p.app import APP
from g2p.cli import (
convert,
doctor,
Expand All @@ -38,7 +38,7 @@ class CliTest(TestCase):
"""Test suite for the g2p Command Line Interface"""

def setUp(self):
self.runner = APP.test_cli_runner()
self.runner = CliRunner()

def test_update(self):
result = self.runner.invoke(update)
Expand Down
5 changes: 3 additions & 2 deletions g2p/tests/test_doctor_expensive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from unittest import TestCase, main

from g2p.app import APP
from click.testing import CliRunner

from g2p.cli import doctor
from g2p.log import LOGGER
from g2p.mappings.langs.utils import check_ipa_known_segs
Expand All @@ -23,7 +24,7 @@ def test_doctor_cli(self):
# TODO: assert something more useful here...
# This test simulates calling "g2p doctor" on the command line with no arguments,
# which runs doctor on all mappings.
runner = APP.test_cli_runner()
runner = CliRunner()
with self.assertLogs(LOGGER, level="WARNING") as cm:
result = runner.invoke(doctor)
self.assertEqual(result.exit_code, 0)
Expand Down
4 changes: 2 additions & 2 deletions g2p/tests/test_z_local_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from unittest import TestCase, main

import yaml
from click.testing import CliRunner

from g2p import exceptions
from g2p.app import APP
from g2p.cli import convert, generate_mapping
from g2p.mappings import Mapping
from g2p.mappings.utils import normalize
Expand All @@ -32,7 +32,7 @@

class LocalConfigTest(TestCase):
def setUp(self):
self.runner = APP.test_cli_runner()
self.runner = CliRunner()
self.mappings_dir = Path(PUBLIC_DIR) / "mappings"

def test_local_config(self):
Expand Down

0 comments on commit db12326

Please sign in to comment.