<commit_before>"""
pyqcy :: QuickCheck-like testing framework for Python
"""
from .arbitraries import *
from .properties import *


def main(module='__main__'):
	"""Test runner. When called, it will look for all properties
	(i.e. functions with @qc decorator) and push them through
	a default number of checks.
	Arguments are intended to mimic those from unittest.main().
	Return value is the total number of properties checked.
	"""
	if isinstance(module, basestring):
		module_name = module
		module = __import__(module_name)
		for part in module_name.split('.')[1:]:
			module = getattr(module, part)

	from .properties import Property

	props = [v for v in module.__dict__.itervalues()
			 if isinstance(v, Property)]
	for p in props:
		p.test()
	return len(props)
	<commit_msg>Runner displays number of passed tests<commit_after>"""
pyqcy :: QuickCheck-like testing framework for Python
"""
from .arbitraries import *
from .properties import *


def main(module='__main__'):
	"""Test runner. When called, it will look for all properties
	(i.e. functions with @qc decorator) and push them through
	a default number of checks.
	Arguments are intended to mimic those from unittest.main().
	Return value is the total number of properties checked.
	"""
	if isinstance(module, basestring):
		module_name = module
		module = __import__(module_name)
		for part in module_name.split('.')[1:]:
			module = getattr(module, part)

	from .properties import Property, DEFAULT_TEST_COUNT

	props = [v for v in module.__dict__.itervalues()
			 if isinstance(v, Property)]
	for p in props:
		p.test()
		print "%s: passed %s test%s." % (p.func.__name__,
			DEFAULT_TEST_COUNT,
			"s" if DEFAULT_TEST_COUNT != 1 else "")
		
	return len(props)
	
{'fraction_non_alphanumeric': 0.1046242774566474, 'fraction_numerical': 0.0017341040462427746, 'mean_word_length': 4.277439024390244, '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': '3780224', 'n_tokens_mistral': 553, 'n_tokens_neox': 515, 'n_words': 198}