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

The test_format_ and test_parse_fa tests has errors #203

Open
forslund opened this issue Jun 15, 2021 · 4 comments · May be fixed by #209
Open

The test_format_ and test_parse_fa tests has errors #203

forslund opened this issue Jun 15, 2021 · 4 comments · May be fixed by #209
Assignees
Labels
bug Something isn't working

Comments

@forslund
Copy link
Collaborator

When running the test suite I get a couple of errors like this:

        def testExtract(text, expected_date, expected_leftover):
            res = extractWithFormat(normalize(text))
            self.assertEqual(res[0], expected_date, "for=" + text)
            self.assertEqual(res[1], expected_leftover, "for=" + text)

        testExtract("الان ساعت اینه",
>                   "2017-06-27 13:04:00", "ساعت اینه")

test/test_parse_fa.py:116:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test_parse_fa.py:112: in testExtract
    self.assertEqual(res[0], expected_date, "for=" + text)
E   AssertionError: '2017-06-27 15:04:00' != '2017-06-27 13:04:00'
E   - 2017-06-27 15:04:00
E   ?             ^
E   + 2017-06-27 13:04:00
E   ?             ^
E    : for=الان ساعت اینه

Best guess, there is something with the timezone?

@forslund forslund added the bug Something isn't working label Jun 15, 2021
@ChanceNCounter
Copy link
Contributor

Yep. TZ PR broke it. I wonder why the tests passed on GitHub. It's not just Farsi, either.

@ChanceNCounter
Copy link
Contributor

Update: Jarbas and I are on it. At least two of these are due to a loss in translation during PR review. Others were masked by naming errors in the Farsi PR.

Still others, which aren't occurring on @forslund's computer but are on mine, remain to be investigated (including one in Swedish oh boy) but I am assuming we introduced the bug at the same time

Further info to follow.

@ChanceNCounter
Copy link
Contributor

Working in spurts, I have yet to determine why the default time zone seems to be changing mid-run. However, many of the datetime tests specify the default time zone when they create their reference datetime objects. I'm now trying to determine if the bug is in the code, or in the tests; is something else interfering with the mechanism that ensures the right time zone, or is it simply that pytest doesn't run tests in order, and timing becomes a factor?

@JarbasAl
Copy link
Collaborator

JarbasAl commented Jun 23, 2021

proposed fix HelloChatterbox#32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants