Skip to content

Fix tests - #1248

Merged
serhii73 merged 6 commits into
masterfrom
fix/tests
Feb 3, 2025
Merged

serhii73 merged 6 commits into
masterfrom
fix/tests

Conversation

@serhii73

Copy link
Copy Markdown
Collaborator

No description provided.

@serhii73 serhii73 changed the title [WIP] Fix tests Fix tests Jan 24, 2025
@serhii73
serhii73 requested review from Gallaecio and wRAR January 24, 2025 11:46
@Gallaecio

Gallaecio commented Jan 27, 2025 •

Copy link
Copy Markdown
Contributor

Why remove fuzzing/requirements.txt? Are you confident it is no longer needed for oss-fuzz? (answered)

Comment thread .github/workflows/cifuzz.yml Resolved
else:
probs, labels = ([], ())

return labels, np.asarray(probs)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We got some error in the test, and it is relative to numpy and this line, so I created this part of the code just copy pasting from the library
https://github.com/facebookresearch/fastText/blob/1142dc4c4ecbc19cc16eee5cdd28472e689267e6/python/fasttext_module/fasttext/FastText.py#L239
but instead
return labels, np.array(probs, copy=False) I written return labels, np.asarray(probs)

Comment thread setup.cfg Outdated
dateparser/data/date_translation_data/*
dateparser/data/__init__.py
dateparser/languages/__init__.py
docs/conf.py

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the pipeline, I got some errors relative to flake, after changing no errors anymore

Comment thread tests/test_clean_api.py
region="",
date_formats=["%a", "%a", "%a", "%a"],
expected_date=datetime(1969, 1, 31, 14, 4),
expected_date=datetime(1969, 1, 31, 13, 4),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just changed the digit to resolve the error in this test

Comment thread tests/test_search.py
"June 23th 5 pm EST",
datetime.datetime(
2023, 6, 23, 17, 0, tzinfo=pytz.timezone("EST")
2023,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread tox.ini Resolved
@Gallaecio

Gallaecio commented Jan 31, 2025 •

Copy link
Copy Markdown
Contributor

I’ve refactored the CI to run extras separately and test minimum versions of dependencies, and replaced flake8 with ruff to simplify things.

I have also removed the proposed fasttext wrapper to instead limit numpy to supported versions when installing the corresponding extra. I don’t think it falls onto us to monkey-patch fasttext. If no one forks the project, we can eventually stop supporting language detection based on it.

@serhii73
serhii73 merged commit 36a5634 into master Feb 3, 2025
serhii73 added a commit that referenced this pull request Feb 3, 2025
* Fix tests

* Fix the TestLocalTZOffset test

* Setup tests for minimum deps

* Run pre-commit

---------

Co-authored-by: Adrián Chaves <adrian@chaves.io>
serhii73 added a commit that referenced this pull request Feb 3, 2025
serhii73 added a commit that referenced this pull request Feb 5, 2025
* Release 1.2.1

* Update HISTORY.rst

Co-authored-by: Andrey Rakhmatullin <wrar@debian.org>

* Fix tests (#1248)

* Fix tests

* Fix the TestLocalTZOffset test

* Setup tests for minimum deps

* Run pre-commit

---------

Co-authored-by: Adrián Chaves <adrian@chaves.io>

* Add #1248 to History rst

* .bumpversion.cfg → pyproject.toml, and have it set the release date

* Undo version change to be made by bump-my-version

* Update HISTORY.rst

Co-authored-by: Adrián Chaves <adrian@chaves.io>

* Use CODECOV_TOKEN.

---------

Co-authored-by: Andrey Rakhmatullin <wrar@debian.org>
Co-authored-by: Adrián Chaves <adrian@chaves.io>
Co-authored-by: Andrey Rakhmatullin <wrar@wrar.name>
@serhii73
serhii73 deleted the fix/tests branch June 22, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants