-
Notifications
You must be signed in to change notification settings - Fork 338
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
Codecov reporting wrong coverage information. #1489
Comments
@sobolevn Would you have any guesses about that? Ever run into anything like this? |
This is what happens when we comment out the pytest plugin: https://app.codecov.io/gh/lk-geimfari/mimesis/pull/1502 The coverage increased to 99%. |
Try to move imports inside the fixture functions. |
@sobolevn Do you mean like this? @pytest.fixture(scope="session")
def _mimesis_cache() -> _CacheCallable:
from mimesis.locales import Locale
from mimesis.schema import Field
cached_instances: dict[Locale, Field] = {}
def factory(locale: Locale) -> Field:
if locale not in cached_instances:
cached_instances[locale] = Field(locale)
return cached_instances[locale]
return factory
@pytest.fixture()
def mimesis_locale(): # type: ignore
"""Specifies which locale to use."""
from mimesis.locales import Locale
return Locale.DEFAULT |
yes |
Alas, it didn't helped. |
This is due to how the import system works and how you're using When python tries to import You can see this in action by doing the following: Now run the python repl and enter this: |
Yeah, I get it, but i did not figured out how can I fix this without breaking anything. Ideas or PR are welcomen. |
I have no idea why, but commit 79f6257 (
Add pytest entry in pyproject.toml
) decreased coverage by 42.21%. Clearly, Codecov is reporting incorrect coverage information and the question is "Why"?The text was updated successfully, but these errors were encountered: