flatironinstitute / ccn-template

Template repository for CCN software projects
https://ccn-template.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
7 stars 2 forks source link

Mocking in tests? #42

Open billbrod opened 10 months ago

billbrod commented 10 months ago

At US-RSE'23, heard several people describe the utility of "mocking" when writing tests, e.g., mockito. Look into whether that's something we should use more.

EricThomson commented 10 months ago

Yes -- big topic. It might be nice to discuss the divisions among things like mocks and fixtures (e.g., tmp_path is a fixture baked into pytest), and tools things like freezegun (it provides specific dates dates/times for testing -- I found it helpful at one point but now it may be replaced by a standard built in for things like mockito which I'd never even heard of :scream:). Rabbit hole alert!!