Open tillea opened 5 years ago
Hi again, is there any additional information you might need to reproduce the unittest errors?
I go the same exact errors while running the unit test on ubuntu 16 (in a docker container). This was using the v0.2.0 release. Happy to help debug too.
python3 -m unittest
.......................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF..
======================================================================
FAIL: test_sort_high_threshold_1 (test.test_sort.TestSort)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Filtlong-0.2.0/test/test_sort.py", line 93, in test_sort_high_threshold_1
self.assertTrue('target: 100,000 bp' in console_out)
AssertionError: False is not true
======================================================================
FAIL: test_sort_high_threshold_1_assembly_ref (test.test_sort.TestSort)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Filtlong-0.2.0/test/test_sort.py", line 101, in test_sort_high_threshold_1_assembly_ref
self.assertTrue('target: 100,000 bp' in console_out)
AssertionError: False is not true
...
Ran 68 tests in 41.534s
FAILED (failures=42)
Ping? Is there any intend to work on this issue?
Hi, I've noticed that Filtlong prints numbers formatted according to the locale (100,000 or 100000), but the unittest scripts expect them to be formatted as 100,000. For the Debian package, we've solved the issue by patching the test files to ignore commas in numbers.
You can take a look at the patch here: https://salsa.debian.org/med-team/filtlong/-/blob/master/debian/patches/ignore_locales_in_test_output.patch
Regards, Pranav
Hi, I've noticed that Filtlong prints numbers formatted according to the locale (100,000 or 100000), but the unittest scripts expect them to be formatted as 100,000. For the Debian package, we've solved the issue by patching the test files to ignore commas in numbers.
You can take a look at the patch here: https://salsa.debian.org/med-team/filtlong/-/blob/master/debian/patches/ignore_locales_in_test_output.patch
Regards, Pranav
I wrote a few shell commands to address this issue for the three offending files:
cd filtlong_folder/test
perl -pi -e 's/(?<=\d),(?=\d)//g' test_sort.py
perl -pi -e 's/(?<=\d),(?=\d)//g' test_split.py
perl -pi -e 's/(?<=\d),(?=\d)//g' test_trim.py
sed -i "s/ bp' in console_out/ bp' in console_out.replace(',', '')/g" test_sort.py
sed -i "s/ bp)' in console_out/ bp)' in console_out.replace(',', '')/g" test_split.py
sed -i "s/ bp)' in console_out/ bp)' in console_out.replace(',', '')/g" test_trim.py
cd filtlong_folder
After these, I got a successful run of python3 -m unittest
More specifically, the results were:
....................................................................
----------------------------------------------------------------------
Ran 68 tests in 50.953s
OK
Hi, I tried to build Filtlong on Debian and was running the test suite:
Please let me know if you need further information. Kind regards, Andreas.