<commit_before>import os


def test_screenshot(needle):
    SCREENSHOT_NAME = 'screenshot_without_baseline'
    needle.driver.get('https://www.example.com')
    try:
        needle.assert_screenshot(SCREENSHOT_NAME)
    except IOError as er:
        pass
    assert os.path.isfile(
        os.path.join(needle.options['output_dir'], SCREENSHOT_NAME+".png")), \
        "Fresh screenshot was not created (there is no baseline image)"<commit_msg>Update screenshot creation test<commit_after>"""test_screenshot_creation
"""

import os
import pytest


def test_screenshot_creation(needle):
    """Verify that fresh images are generated regardless if there are baselines

    :param needle:
    :return:
    """

    if needle.save_baseline:
        pytest.skip('Only run screenshot creation for non-baseline runs')

    screenshot_name = 'screenshot_without_baseline'
    screenshot_path = os.path.join(needle.output_dir, screenshot_name+".png")
    needle.driver.get('https://www.example.com')

    try:
        needle.assert_screenshot(screenshot_name)
    except IOError:
        pass

    assert os.path.isfile(screenshot_path), "Fresh screenshot was not created (there is no baseline image)"
{'fraction_non_alphanumeric': 0.09899328859060402, 'fraction_numerical': 0.0, 'mean_word_length': 3.791164658634538, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6064106', 'n_tokens_mistral': 380, 'n_tokens_neox': 369, 'n_words': 83}