clbarnes / jeiss-convert

Convert Jeiss .dat files to HDF5
MIT License
2 stars 2 forks source link

convert.py raises TypeError when running pytests #12

Closed trautmane closed 1 year ago

trautmane commented 1 year ago

I get the following error when running pytests against the main branch:

...

    def test_convert_verify(dat_path, tmpdir):
        hdf5_path = Path(tmpdir / "data.hdf5")
>       conv_status = convert.main([str(dat_path), str(hdf5_path)])

tests/test_main.py:14: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = ['/Users/trautmane/Library/Caches/pooch/5e4857507ee26906a55d53c8521aa8c3-FIBdeSEMAna_21-12-26_005024_0-0-0.dat', '/private/var/folders/20/tlp7t8px5rs_fss5shprz2nm0000gq/T/pytest-of-trautmane/pytest-16/test_convert_verify_8_0/data.hdf5']

...

        filename = None
        if parsed.store_name == 1:
            filename = parsed.dat.name
        elif parsed.store_name == 2:
            filename = str(parsed.dat)
>       elif parsed.store_name >= 3:
E       TypeError: '>=' not supported between instances of 'NoneType' and 'int'

jeiss_convert/convert.py:246: TypeError

...

=========================== short test summary info ============================
FAILED tests/test_main.py::test_convert_verify[8] - TypeError: '>=' not suppo...
=================== 1 failed, 7 passed, 56 skipped in 10.73s ===================

Are you able to run the tests successfully? Any idea what I might be doing wrong?

Thanks!

trautmane commented 1 year ago

I see that the GitHub action runs the tests with --skip-full which avoids this failure.

clbarnes commented 1 year ago

Should be fixed now, it was due to argparse's handling of action="count" items.