leforestier / yattag

Python library to generate HTML or XML in a readable, concise and pythonic way.
333 stars 31 forks source link

Out of box pytest support #75

Closed AMDmi3 closed 1 year ago

AMDmi3 commented 1 year ago

pytest won't run yattag tests out of box because of custom naming. To fix that, either:

To run tests in FreeBSD port of yattag I've went the third way and have patched setup.cfg (which is present in the yattag distribution from PyPI) with the following:

--- setup.cfg.orig  2023-01-02 11:51:34 UTC
+++ setup.cfg
@@ -2,3 +2,5 @@
 tag_build = 
 tag_date = 0

+[tool:pytest]
+python_files = tests_*.py
sandrotosi commented 1 year ago

i was about to open an issue for the same reason. I think the "unofficial" standard is to call the tests files with a test_ prefix, so my suggestion would be to just do that, which will cause the least amount of changes and get the same end result (pytest able to collect and run the tests automatically) -- thanks!