<commit_before># -*- coding: utf-8 -*-
#
# test_system-test_rules.py
#
# purpose:  Test system-test rules
# author:   <NAME>
# e-mail:   <EMAIL>
# web:      http://ocefpaf.github.io/
# created:  14-Aug-2014
# modified: Wed 20 Aug 2014 09:55:13 PM BRT
#
# obs:
#

import os
import unittest


class RunNotebooks(unittest.TestCase):
    def setUp(self):
        files = []
        path = os.path.abspath(os.path.join(os.getcwd(), os.pardir, os.pardir))
        for root, dirs, fnames in os.walk(path):
            for fname in fnames:
                if fname.endswith(".ipynb"):
                    files.append(os.path.join(root, fname))
        self.files = files

    def tearDown(self):
        unittest.TestCase.tearDown(self)

    def test_pyfile_exists(self):
        """Test the .py version of the .ipynb exists."""
        for fname in self.files:
            folder, ipy_file = os.path.split(fname)
            py_file = fname[:-5] + 'py'
            print('Looking for:\n{}\n'.format(py_file))
            self.assertTrue(os.path.isfile(py_file))

    def test_conda_requeriment_exists(self):
        """Check if there is a conda-requirements.txt for the notebook."""
        for fname in self.files:
            folder, ipy_file = os.path.split(fname)
            req = os.path.join(folder, 'conda-requirements.txt')
            print('Looking for:\n{}\n'.format(req))
            self.assertTrue(os.path.isfile(req))

    def test_pip_requeriment_exists(self):
        """Check if there is a pip-requirements.txt for the notebook."""
        for fname in self.files:
            folder, ipy_file = os.path.split(fname)
            req = os.path.join(folder, 'pip-requirements.txt')
            print('Looking for:\n{}\n'.format(req))
            self.assertTrue(os.path.isfile(req))


def main():
    unittest.main()


if __name__ == '__main__':
    main()<commit_msg>Printing only when not found.<commit_after># -*- coding: utf-8 -*-
#
# test_system-test_rules.py
#
# purpose:  Test system-test rules
# author:   <NAME>
# e-mail:   <EMAIL>
# web:      http://ocefpaf.github.io/
# created:  14-Aug-2014
# modified: Wed 20 Aug 2014 09:55:13 PM BRT
#
# obs:
#

import os
import unittest


class RunNotebooks(unittest.TestCase):
    def setUp(self):
        files = []
        path = os.path.abspath(os.path.join(os.getcwd(), os.pardir, os.pardir))
        for root, dirs, fnames in os.walk(path):
            if 'backup' not in root:
                for fname in fnames:
                    if fname.endswith(".ipynb"):
                        files.append(os.path.join(root, fname))
        self.files = files

    def tearDown(self):
        unittest.TestCase.tearDown(self)

    def test_pyfile_exists(self):
        """Test the .py version of the .ipynb exists."""
        for fname in self.files:
            folder, ipy_file = os.path.split(fname)
            py_file = fname[:-5] + 'py'
            req = os.path.isfile(py_file)
            if not req:
                print('Cannot find:\n{}\n'.format(req))
            self.assertTrue(req)

    def test_conda_requeriment_exists(self):
        """Check if there is a conda-requirements.txt for the notebook."""
        for fname in self.files:
            folder, ipy_file = os.path.split(fname)
            req = os.path.join(folder, 'conda-requirements.txt')
            if not os.path.isfile(req):
                print('Cannot find:\n{}\n'.format(req))
            self.assertTrue(os.path.isfile(req))

    def test_pip_requeriment_exists(self):
        """Check if there is a pip-requirements.txt for the notebook."""
        for fname in self.files:
            folder, ipy_file = os.path.split(fname)
            req = os.path.join(folder, 'pip-requirements.txt')
            if not os.path.isfile(req):
                print('Cannot find:\n{}\n'.format(req))
            self.assertTrue(os.path.isfile(req))


def main():
    unittest.main()


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.13747788728834975, 'fraction_numerical': 0.010108668182966895, 'mean_word_length': 2.1689351481184946, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6635988', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1299, 'n_words': 289}