Coding 2021-05-02

By Max Woerner Chase

All right, source coverage at 100%, missed function in my conftest that came from the template; I don't want to delete it until I understand what the purpose of it was. Once that was done, I started figuring out what it would take to port the first prototype code into the second prototype. This is going to take a lot of work to define the relevant tests, since suddenly the code is going to care significantly about the filesystem in a way it doesn't currently.

I think I want a function-scoped fixture that sets up and tears down a temporary directory, and allows writing files under that directory. Then, it's just a matter of performing various iterations of, "point the code or the arguments at the directory, and make sure everything resolves as expected". Also going to need to make sure that the current directory gets reset at the end of every test, if pytest doesn't handle that already. Let's see, I guess that could be done by using the monkeypatch fixture and patching its chdir method over the os.chdir visible to part of the program logic. Bundle that up in a fixture itself, because I'm going to want to do that a lot, but I don't want to write it a lot.

Once all of this is written, or at least better planned, I'll need to go over the existing tests and figure out how to fix them, because this logic is probably going to apply to them.

Kind of pondering making the fixture auto-use and making it consume marks do do stuff like "add a default configuration file". This is all interesting and slightly complicated and something I shouldn't work on at this time of night.

Good night.