Skip to content

Commit

Permalink
✅ Fix pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Jul 5, 2023
1 parent a128fdd commit 5b7f2dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 4 additions & 4 deletions tests/json/google.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
{
"translator": "google",
"sl": "auto",
"tl": "zh_TW",
"tl": "zh_CN",
"text": "The Mythical Man-Month",
"phonetic": "",
"paraphrase": "人月神話",
"paraphrase": "神话般的人月",
"explains": {},
"details": {},
"alternatives": ["神话般的人月"]
"alternatives": ["人月神话"]
}
],
"text": "The Mythical Man-Month",
"to_lang": "zh_TW",
"to_lang": "zh_CN",
"from_lang": "auto"
}
8 changes: 1 addition & 7 deletions tests/translate_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"""Test translators."""
import json
import sys

import pytest

from translate_shell.translate import translate

Expand All @@ -12,12 +9,9 @@
class Test:
"""Test."""

@pytest.mark.skipif(
sys.platform == "win32", reason="'charmap' codec can't decode byte"
)
def test_google(self) -> None:
"""Test google"""
rst = vars(translate("The Mythical Man-Month", "zh_TW"))
rst = vars(translate("The Mythical Man-Month", "zh_CN"))
expected = json.loads(
(ASSETS_PATH / "json" / "google.json").read_text()
)
Expand Down

0 comments on commit 5b7f2dc

Please sign in to comment.