<commit_before>import os
import sys
from subprocess import (
    Popen,
    PIPE,
)

import pytest

from msl.loadlib import LoadLibrary

config_path = sys.executable + '.config'


def teardown_module():
    # clean up
    if os.path.isfile(config_path):
        os.remove(config_path)


def test_framework_3_5():
    # The python.exe.config file must exist before the Python interpreter
    # starts in order for pythonnet to load a library from .NET <4.0. That
    # is why we must use subprocess for this test. The 'legacy_v2_runtime.py'
    # script must be run in a different Python process which depends on
    # whether python.exe.config exists before the subprocess runs.

    root_dir = os.path.join(os.path.dirname(__file__), 'dotnet_config')
    script = os.path.join(root_dir, 'legacy_v2_runtime.py')

    assert os.path.isfile(script)

    if os.path.isfile(config_path):
        os.remove(config_path)<commit_msg>skip test_framework_3_5 if not Windows<commit_after>import os
import sys
from subprocess import (
    Popen,
    PIPE,
)

import pytest

from msl.loadlib import (
    LoadLibrary,
    IS_WINDOWS,
)

config_path = sys.executable + '.config'


def teardown_module():
    # clean up
    if os.path.isfile(config_path):
        os.remove(config_path)


@pytest.mark.skipif(not IS_WINDOWS, reason='only valid on Windows')
def test_framework_3_5():
    # The python.exe.config file must exist before the Python interpreter
    # starts in order for pythonnet to load a library from .NET <4.0. That
    # is why we must use subprocess for this test. The 'legacy_v2_runtime.py'
    # script must be run in a different Python process which depends on
    # whether python.exe.config exists before the subprocess runs.

    root_dir = os.path.join(os.path.dirname(__file__), 'dotnet_config')
    script = os.path.join(root_dir, 'legacy_v2_runtime.py')

    assert os.path.isfile(script)

    if os.path.isfile(config_path):
        os.remove(config_path)
{'fraction_non_alphanumeric': 0.08781725888324873, 'fraction_numerical': 0.007106598984771574, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1544958', 'n_tokens_mistral': 649, 'n_tokens_neox': 634, 'n_words': 190}