lexibank / pylexibank

The python curation library for lexibank
Apache License 2.0
18 stars 7 forks source link

Check is setup.cfg is present. #196

Closed SimonGreenhill closed 4 years ago

SimonGreenhill commented 4 years ago

pytest will not run lexibank tests if there is no setup.cfg file (I noticed some lexibank datasets had tests that weren't being run). Do we want to implement this as a lexibank check or cldfbench check? (i.e. if 'test.py'.exists() and not 'setup.cfg'.exists())

SimonGreenhill commented 4 years ago

..and the inverse of this -- where setup.cfg is present (expecting a test.py), when test.py is missing.

xrotwang commented 4 years ago

The inverse does not need to be checked since it will result in a build error anyway.

xrotwang commented 4 years ago

Specifying args for pytest in a setup.cfg is just a convention, though. I think we want to also allow datasets to simply have a test_dataset.py module, which will be discovered by pytest without a need for setup.cfg. (test.py does not work, because the default pattern pytest looks for is test_*.py - note the extra underscore)

SimonGreenhill commented 4 years ago

Ok, we have the lexibank_XX.py convention, we could move all the test.py to test_XX.py, and remove setup.cfg (annoying to change lots of datasets now, but it makes one less point of failure?). And one less boilerplate file ("setup.cfg")

xrotwang commented 4 years ago

I kinda like setup.cfg. Why not keep it as is - i.e. by default there's setup.cfg and test.py, but datasets may also remove setup.cfg and have tests in test_xx.py? Or maybe change the dataset in cldfbench so that in the future the layout is different. But I don't think there's enough reason to retro-fit all existing datasets.

SimonGreenhill commented 4 years ago

Yeah, and we could just work around this on buildbot by changing the pytest config to something like:

[pytest]
python_files = test_*.py test.py
xrotwang commented 4 years ago

Moved to cldf-buildbot issue.