sciunto-org/python-bibtexparser — pull request #49 by grochmal (2014-11-24 19:04:49+00:00)
Title: BibTeX comma first syntax

Comma first syntax is allowed by Patashnik's original BibTeX implementation, and it is popular among people that use functional languages. Notably the Glasgow Haskell Compiler at the University of Glasgow. Support for such input was needed by me for a django project that is using the bibtex parser. The changes in this pull request are the hacks I did to make bibtexparser work in an environment where the comma first syntax is often used.

To ensure that the changes do not break the package in any way I've run all unittests under both python 2.7 and python 3.4 . Also, to ensure the proper functioning of the comma fisrt feature in the future I've added two more unittests (one for the bparser and one for the bwriter) focused on comma first syntax.

I am not sure of how you perform the unitesting of the bibtexparser package (as I have never used tox), yet the following simple script (when copied to the root of the project) does the job of running all tests:

#!/bin/sh
DIR=$(dirname $(readlink -e "$0"))
cd $DIR
touch bibtexparser/tests/__init__.py
P2=$(which python2 2>/dev/null)
P3=$(which python3 2>/dev/null)
for p in $P2 $P3; do
echo $p -m unittest discover -t . -s bibtexparser/tests -p 'test_*.py'
$p -m unittest discover -t . -s bibtexparser/tests -p 'test_*.py'
done
rm bibtexparser/tests/__init__.py

This script was not added to the pull request, as it is not part of the given feature. On the other hand I'd suggest adding this script, or better, some instructions on using tox to the README of the project.