diff --git a/.travis.yml b/.travis.yml index d2e5d467d..8857fef77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,5 @@ install: - sudo apt-get install portaudio19-dev - pip install -r requirements.txt - pip install nose - - pip install coveralls -script: nosetests ./tests --with-coverage --cover-package=./anki +script: nosetests ./tests --processes=16 diff --git a/tests/test_collection.py b/tests/test_collection.py index 1d221d199..2338da991 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -9,7 +9,7 @@ from anki import Collection as aopen newPath = None newMod = None -def test_create(): +def test_create_open(): global newPath, newMod (fd, path) = tempfile.mkstemp(suffix=".anki2", prefix="test_attachNew") try: @@ -24,12 +24,11 @@ def test_create(): newMod = deck.mod del deck -def test_open(): + # reopen deck = aopen(newPath) assert deck.mod == newMod deck.close() -def test_openReadOnly(): # non-writeable dir assertException(Exception, lambda: aopen("/attachroot.anki2")) diff --git a/tests/test_latex.py b/tests/test_latex.py index 376abb2d8..8b5937a20 100644 --- a/tests/test_latex.py +++ b/tests/test_latex.py @@ -57,47 +57,28 @@ def test_latex(): # turn it on again so other test don't suffer anki.latex.build = True -def test_bad_latex_command_write18(): + # bad commands (result, msg) = _test_includes_bad_command("\\write18") assert result, msg - -def test_bad_latex_command_readline(): (result, msg) = _test_includes_bad_command("\\readline") assert result, msg - -def test_bad_latex_command_input(): (result, msg) = _test_includes_bad_command("\\input") assert result, msg - -def test_bad_latex_command_include(): (result, msg) = _test_includes_bad_command("\\include") assert result, msg - -def test_bad_latex_command_catcode(): (result, msg) = _test_includes_bad_command("\\catcode") assert result, msg - -def test_bad_latex_command_openout(): (result, msg) = _test_includes_bad_command("\\openout") assert result, msg - -def test_bad_latex_command_write(): (result, msg) = _test_includes_bad_command("\\write") assert result, msg - -def test_bad_latex_command_loop(): (result, msg) = _test_includes_bad_command("\\loop") assert result, msg - -def test_bad_latex_command_def(): (result, msg) = _test_includes_bad_command("\\def") assert result, msg - -def test_bad_latex_command_shipout(): (result, msg) = _test_includes_bad_command("\\shipout") assert result, msg -def test_good_latex_command_works(): # inserting commands beginning with a bad name should not raise an error (result, msg) = _test_includes_bad_command("\\defeq") assert not result, msg @@ -108,7 +89,7 @@ def test_good_latex_command_works(): def _test_includes_bad_command(bad): d = getEmptyCol() f = d.newNote() - f['Front'] = '[latex]%s[/latex]' % bad; + f['Front'] = '[latex]%s[/latex]' % bad d.addNote(f) q = f.cards()[0].q() return ("'%s' is not allowed on cards" % bad in q, "Card content: %s" % q) diff --git a/tools/tests.sh b/tools/tests.sh index a73184f8e..08e9c7b9a 100755 --- a/tools/tests.sh +++ b/tools/tests.sh @@ -22,5 +22,4 @@ else args="" echo "Call with coverage=1 to run coverage tests" fi -(cd $dir && nosetests3 -vs $lim $args --cover-package=anki) - +(cd $dir && nosetests -vs --processes=16 $lim $args --cover-package=anki)