<commit_before>import os
import subprocess
import sys

from . import PostgreSQLSimpleTestCase


class PostgresIntegrationTests(PostgreSQLSimpleTestCase):
    def test_check(self):
        result = subprocess.run(
            [sys.executable, '-m', 'django', 'check', '--settings', 'integration_settings'],
            stdout=subprocess.DEVNULL,
            stderr=subprocess.PIPE,
            cwd=os.path.dirname(__file__),
        )
        stderr = '\n'.join([e.decode() for e in result.stderr.splitlines()])
        self.assertEqual(result.returncode, 0, msg=stderr)<commit_msg>Ensured that our django checkout is in the pythonpath during tests.<commit_after>import os
import subprocess
import sys

from . import PostgreSQLSimpleTestCase


class PostgresIntegrationTests(PostgreSQLSimpleTestCase):
    def test_check(self):
        test_environ = os.environ.copy()
        if 'DJANGO_SETTINGS_MODULE' in test_environ:
            del test_environ['DJANGO_SETTINGS_MODULE']
        test_environ['PYTHONPATH'] = os.path.join(os.path.dirname(__file__), '../../')
        result = subprocess.run(
            [sys.executable, '-m', 'django', 'check', '--settings', 'integration_settings'],
            stdout=subprocess.DEVNULL,
            stderr=subprocess.PIPE,
            cwd=os.path.dirname(__file__),
            env=test_environ
        )
        stderr = '\n'.join([e.decode() for e in result.stderr.splitlines()])
        self.assertEqual(result.returncode, 0, msg=stderr)
{'fraction_non_alphanumeric': 0.12018906144496962, 'fraction_numerical': 0.0013504388926401081, 'mean_word_length': 3.0491803278688523, 'pattern_counts': {'":': 0, '<': 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': '1201534', 'n_tokens_mistral': 439, 'n_tokens_neox': 431, 'n_words': 86}