pydocstringformatter
pydocstringformatter copied to clipboard
Tests run directly in the testing directory
When I was working on my PR, I noticed that tests run directly on the data directories within the tests directory (Im sorry for the complicated sentence). Or the file path is passed directly as an argument.
Since some of the functionality modifies the document in-place, I am suggesting adding two fixtures/helper functions.
- CloneFile 2. copy the contents of a file to a temporary file.
- CloneDirectory
- Copies the contents of a directory to a temporary directory
- Changes the directory to that directory (monkeypatch it)
This would allow less boilerplate code on the tests, since it would automatically clean up any changes that occur on the files (which might or might not be intended)
Use case ... if someone screws up coding and flips the "-write" parameter, it will not modify all the test files.
LMK what you think
Any fixture that improves the tests is always appreciated!
If possible, separate both fixtures in two PRs so we can review and merge them more easily!