ssato / python-anyconfig

Python library provides common APIs to load and dump configuration files in various formats
MIT License
278 stars 31 forks source link

python2 setup.py test doesnt run tests #101

Closed jayvdb closed 5 years ago

jayvdb commented 5 years ago

python2 setup.py test exits silently running 0 tests.

The run fine on python3.

Also running python -m nose and python -m pytest didnt work on py2 or py3 - both run 0 tests.

ssato commented 5 years ago

Thanks a lot for your report!

python2 setup.py test exits silently running 0 tests.

The run fine on python3.

I don't use 'python* setup.py test' and use an wrapper script (https://github.com/ssato/python-anyconfig/blob/master/pkg/runtest.sh) to perform not only unit tests but also some lint and style checks, or tox (ex. tox -e py27, tox -e py36) instead. So it's expected behavior basically.

SEEALSO: https://python-anyconfig.readthedocs.io/en/latest/?badge=latest#how-to-test

Also running python -m nose and python -m pytest didnt work on py2 or py3 - both run 0 tests.

I'm not sure why those do not work but it might be that filenames of test code under tests/ do not start with 'test' prefix.

jayvdb commented 5 years ago

python* setup.py test is the default and should be supported. packaging tools use it, and packagers do not want to run lint/style/etc so a unix only script is not an acceptable solution.

re test filenames, same problem at https://github.com/ssato/python-anytemplate/issues/7

and yes, the problem was the filenames. pytest default filename glob can be changed in setup.cfg and friends; im not sure about nose.

ssato commented 5 years ago

python* setup.py test is the default and should be supported.

Sorry but I doubt it and don't agree w/ you.

Anyway, I agree in principle with you and I remove the test wrapper script (which I've been put in my todo list for a long time) and replaced it with tox in a series of the latest commits in the next branch.