Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test fails: test_file_ascii and test_file_utf8: AssertionError #393

Closed
2 tasks done
nunotexbsd opened this issue Jan 13, 2023 · 3 comments · Fixed by #395
Closed
2 tasks done

test fails: test_file_ascii and test_file_utf8: AssertionError #393

nunotexbsd opened this issue Jan 13, 2023 · 3 comments · Fixed by #395

Comments

@nunotexbsd
Copy link

Prerequisites

  • Did you make sure a similar issue didn't exist?
  • Did you update gTTS to the latest? (pip install --upgrade gTTS)

Current Behaviour (steps to reproduce)

gtts/tests/test_cli.py::test_file_ascii FAILED                           [ 15%]
gtts/tests/test_cli.py::test_file_utf8 FAILED                            [ 16%]
(...)
=================================== FAILURES ===================================
_______________________________ test_file_ascii ________________________________

    @pytest.mark.net
    def test_file_ascii():
        with LogCapture() as lc:
            result = runner_debug(["--file", textfile_ascii])
            log = logcapture_str(lc)

>       assert "text: %s" % text in log
E       assert ('text: %s' % "Can you make pink a little more pinkish can you make pink a little more pinkish, nor can you make the font bigger?\nHow much will it cost the website doesn't have the theme i was going for.") in 'No logging captured'

gtts/tests/test_cli.py:233: AssertionError
________________________________ test_file_utf8 ________________________________

    @pytest.mark.net
    def test_file_utf8():
        with LogCapture() as lc:
            result = runner_debug(["--file", textfile_utf8])
            log = logcapture_str(lc)

>       assert "text: %s" % text_unicode in log
E       AssertionError: assert ('text: %s' % '这是一个三岁的小孩\n在讲述她从一系列照片里看到的东西。\n对这个世界, 她也许还有很多要学的东西,\n但在一个重要的任务上, 她已经是专家了:\n去理解
她所看到的东西。') in 'No logging captured'

gtts/tests/test_cli.py:243: AssertionError
======================== 2 failed, 95 passed in 33.54s =========================

Environment

platform freebsd13 -- Python 3.9.16, pytest-7.2.0, pluggy-1.0.0 -- /usr/local/bin/python3.9
cachedir: .pytest_cache
rootdir: /wrkdirs/usr/ports/audio/py-gtts/work-py39/gTTS-2.3.0, configfile: pyproject.toml
plugins: cov-2.9.0

  • gTTS version: 2.3.0
  • Operating System version: FreeBSD 13.1 amd64

Any clues?

@pndurette
Copy link
Owner

pndurette commented Jan 15, 2023

Hi @nunotexbsd!

Are you running the tests from the installed version of gTTS by any chance?
It looks like the input files used for these 2 tests aren't packaged (because they're .txt and not picked up by default)

I was actually wanting to remove the tests altogether from the package itself. Is there a reason why you want to run the tests from there?

@nunotexbsd
Copy link
Author

I'm doing tests from source gTTS-2.3.0.tar.gz tarball from pypi.org.

@pndurette
Copy link
Owner

Ah the source should indeed contain all tests and their required files. I'll include them in.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants