Skip to content
Snippets Groups Projects
Commit b349ddaf authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME
Browse files

ensure tests pass with python2.7

parent 40332754
No related branches found
No related tags found
2 merge requests!54Refactors the score loading and scripts functionality,!52generic plotting script for bob measure
Pipeline #
'''Tests for bob.measure scripts''' '''Tests for bob.measure scripts'''
import sys
import os import os
import filecmp import filecmp
import tempfile import tempfile
...@@ -17,7 +18,10 @@ def test_metrics(): ...@@ -17,7 +18,10 @@ def test_metrics():
with open('tmp', 'w') as f: with open('tmp', 'w') as f:
f.write(result.output) f.write(result.output)
test_ref = bob.io.base.test_utils.datafile('test_m1.txt', 'bob.measure') test_ref = bob.io.base.test_utils.datafile('test_m1.txt', 'bob.measure')
assert filecmp.cmp(test_ref, 'tmp') assert result.exit_code == 0
#reference case has been generated using python 3.6
if sys.version_info >= (3, 6):
assert filecmp.cmp(test_ref, 'tmp')
dev2 = bob.io.base.test_utils.datafile('dev-2.txt', 'bob.measure') dev2 = bob.io.base.test_utils.datafile('dev-2.txt', 'bob.measure')
test1 = bob.io.base.test_utils.datafile('test-1.txt', 'bob.measure') test1 = bob.io.base.test_utils.datafile('test-1.txt', 'bob.measure')
...@@ -29,7 +33,10 @@ def test_metrics(): ...@@ -29,7 +33,10 @@ def test_metrics():
with open('tmp', 'w') as f: with open('tmp', 'w') as f:
f.write(result.output) f.write(result.output)
test_ref = bob.io.base.test_utils.datafile('test_m2.txt', 'bob.measure') test_ref = bob.io.base.test_utils.datafile('test_m2.txt', 'bob.measure')
assert filecmp.cmp(test_ref, 'tmp') assert result.exit_code == 0
#reference case has been generated using python 3.6
if sys.version_info >= (3, 6):
assert filecmp.cmp(test_ref, 'tmp')
with runner.isolated_filesystem(): with runner.isolated_filesystem():
result = runner.invoke( result = runner.invoke(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment