<commit_before>#!/bin/bash

ROOTDIR="$( dirname "$BASH_SOURCE" )/.."
cd "$ROOTDIR"

if [ $# == 0 ]; then

    ## Discover & run all the tests
    unit2 discover -v

else

    ## If --list was passed, list the tests
    if [ "$1" == "--list" ]; then
	find smartrpyc/tests/ -name 'test_*.py' | sed 's@/@.@g;s#\.py$##' | sort
	exit
    fi

    ## Run the selected tests
    unit2 -v "$@"

fi<commit_msg>More portable run_tests.sh<commit_after>#!/bin/bash

ROOTDIR="$( dirname "$BASH_SOURCE" )/.."
cd "$ROOTDIR"

if which unit2 &>/dev/null; then
    UNITTEST=unit2
else
    UNITTEST="python -m unittest"
fi


if [ $# == 0 ]; then

    ## Discover & run all the tests
    $UNITTEST discover -v

else

    ## If --list was passed, list the tests
    if [ "$1" == "--list" ]; then
	find smartrpyc/tests/ -name 'test_*.py' | sed 's@/@.@g;s#\.py$##' | sort
	exit
    fi

    ## Run the selected tests
    $UNITTEST -v "$@"

fi
{'fraction_non_alphanumeric': 0.18865866957470012, 'fraction_numerical': 0.008724100327153763, 'mean_word_length': 2.558139534883721, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1312046', 'n_tokens_mistral': 373, 'n_tokens_neox': 343, 'n_words': 102}