programming, python 

Most of the pytest unit test code I'm looking at ends up turning into giant write-once files (revisit only if tests fail) that are impossible to navigate -- do folks know of open source projects in the Python world that do a really exemplary job organizing their tests (not just the files, but the contents of said files, and the names/object hierarchy of the tests)?

programming, python 

@eloquence
Here's one of my projects:
gitlab.com/StuntsPT/Structure_
It's not ideal, but somewhat organized and partitioned.
Don't forget to check the `.gitlab-ci.yml` file and the CI logs for an idea on how it works.
Hope it helps.

programming, python 

@FPinaMartins Thank you -- I certainly like the relatively small size per file. Right now I'm fighting with files like github.com/freedomofpress/secu (admittedly the tested widgets.py reaaaally needs to be refactored).

Follow

programming, python 

@eloquence
Thanks, we tried our best to avoid having very large files, since there were 3 of us working together at one time.
That `test_widgets.py` is certainly huge! If you are going to refactor that, *maybe* you could consider segregating parts of `widgets.py` too. It might make the job of refactoring the tests easier too.
I leave answering the question of whether the efforts compensate the benefits to you. _-)

· · Web · 0 · 0 · 1
Sign in to participate in the conversation
Scholar Social

Scholar Social is a microblogging platform for researchers, grad students, librarians, archivists, undergrads, academically inclined high schoolers, educators of all levels, journal editors, research assistants, professors, administrators—anyone involved in academia who is willing to engage with others respectfully.