pydocstringformatter icon indicating copy to clipboard operation
pydocstringformatter copied to clipboard

Tests run directly in the testing directory

Open jspaezp opened this issue 2 years ago • 1 comments

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.

  1. CloneFile 2. copy the contents of a file to a temporary file.
  2. CloneDirectory
    1. Copies the contents of a directory to a temporary directory
    2. 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

jspaezp avatar Sep 07 '22 21:09 jspaezp

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!

DanielNoord avatar Sep 08 '22 08:09 DanielNoord