From 7a68632c7b5d73e1ee67278c930f67e692a1c56b Mon Sep 17 00:00:00 2001 From: Mike <45373284+munkhuushmgl@users.noreply.github.com> Date: Mon, 1 Jun 2020 13:10:03 -0700 Subject: [PATCH] test: flaky test, NMT model has changed (#13) --- noxfile.py | 2 +- tests/system.py | 6 +++++- tests/unit/v2/test__http.py | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index e77586a4..cf50e978 100644 --- a/noxfile.py +++ b/noxfile.py @@ -138,7 +138,7 @@ def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") + session.install("sphinx<3.0.0", "alabaster", "recommonmark") shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( diff --git a/tests/system.py b/tests/system.py index b92ead12..975d3a22 100644 --- a/tests/system.py +++ b/tests/system.py @@ -67,7 +67,11 @@ def test_translate(self): self.assertEqual(translations[1]["translatedText"].lower(), u"fünfzehn") self.assertEqual(translations[2]["detectedSourceLanguage"], "es") - self.assertEqual(translations[2]["translatedText"].lower(), u"ich heiße jeff") + es_translation = translations[2]["translatedText"].lower() + self.assertTrue( + es_translation == u"ich heiße jeff" + or es_translation == u"mein name ist jeff" + ) self.assertEqual(translations[3]["detectedSourceLanguage"], "en") self.assertEqual( diff --git a/tests/unit/v2/test__http.py b/tests/unit/v2/test__http.py index 9537084c..4830c0c8 100644 --- a/tests/unit/v2/test__http.py +++ b/tests/unit/v2/test__http.py @@ -80,9 +80,9 @@ def test_extra_headers(self): self.assertEqual(result, data) expected_headers = { + "Accept-Encoding": "gzip", base_http.CLIENT_INFO_HEADER: conn.user_agent, "User-Agent": conn.user_agent, - "Accept-Encoding": "gzip", } expected_uri = conn.build_api_url("/rainbow") http.request.assert_called_once_with( @@ -90,5 +90,5 @@ def test_extra_headers(self): headers=expected_headers, method="GET", url=expected_uri, - timeout=None, + timeout=60, )