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

Modernization - May 2024 #16

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions tests/data/project7/file1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# TIMEBOMB: FEWTURE-BOOM1
# FEWTURE-DO-NOT-REPORT: do not report, it's not within an annotation

Choose a reason for hiding this comment

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

J'ai bien envie de d'utiliser le terme FEWTURE premier degré maintenant 😄

1 change: 1 addition & 0 deletions tests/data/project7/file2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TIMEBOMB: FEWTURE-BOOM2
25 changes: 25 additions & 0 deletions tests/test_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

from check_oldies import annotations

from . import base


FAKE_GIT_BLAME_OUTPUT = """c106813f91ff43b8fc6e231c263bdaa344866157 136 136 1
some value
Expand Down Expand Up @@ -65,3 +67,26 @@ def test_get_login_from_committer_email():
assert login == "<@example.com>" # should not be the empty string
login = annotations.get_login_from_committer_email("John Smith")
assert login == "John Smith"



class TestGetKnownFutureTag:
test_data_path = base.TEST_DIR_PATH / "data/project7"

def test_basics(self):
tags = annotations.get_known_future_tags(
directory=self.test_data_path,
annotation_regex=base.TESTING_ANNOTATIONS[0],
future_tag_regex=base.TESTING_FUTURE_TAG,
whitelist=(),
)
assert tags == {"FEWTURE-BOOM1", "FEWTURE-BOOM2"}

Choose a reason for hiding this comment

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

Est-ce que le tag n'est pas TIMEBOMB ici ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Le tag cherché est bien de type "FUTURE-xxx".

"TIMEBOMB", c'est en fait un "FIXME". Peut-être que je devrais le nommer "FIIXME" dans les tests, ce sera plus proche de "FIXME" et donc plus clair.


def test_whitelist(self):
tags = annotations.get_known_future_tags(
directory=self.test_data_path,
annotation_regex=base.TESTING_ANNOTATIONS[0],
future_tag_regex=base.TESTING_FUTURE_TAG,
whitelist=["file2.py"],
)
assert tags == {"FEWTURE-BOOM1"}