<commit_before>from tests.helper import ExternalVersionTestCase


class GitHubTest(ExternalVersionTestCase):
    def test_github(self):
        self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo"}), "20140122")

    def test_github_latest_release(self):
        self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo", "use_latest_release": 1}), "release3")

    def test_github_max_tag(self):
        self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo", "use_max_tag": 1}), "second_release")<commit_msg>Skip github tests if NVCHECKER_GITHUB_TOKEN not present<commit_after>import os
import pytest
from tests.helper import ExternalVersionTestCase


@pytest.mark.skipif("NVCHECKER_GITHUB_TOKEN" not in os.environ,
                    reason="requires NVCHECKER_GITHUB_TOKEN, or it fails too much")
class GitHubTest(ExternalVersionTestCase):
    def test_github(self):
        self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo"}), "20140122")

    def test_github_latest_release(self):
        self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo", "use_latest_release": 1}), "release3")

    def test_github_max_tag(self):
        self.assertEqual(self.sync_get_version("example", {"github": "harry-sanabria/ReleaseTestRepo", "use_max_tag": 1}), "second_release")
{'fraction_non_alphanumeric': 0.1275579809004093, 'fraction_numerical': 0.015006821282401092, 'mean_word_length': 6.15609756097561, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3702172', 'n_tokens_mistral': 470, 'n_tokens_neox': 455, 'n_words': 76}