Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests run directly in the testing directory #157

Open
jspaezp opened this issue Sep 7, 2022 · 1 comment
Open

Tests run directly in the testing directory #157

jspaezp opened this issue Sep 7, 2022 · 1 comment

Comments

@jspaezp
Copy link
Contributor

jspaezp commented Sep 7, 2022

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

@DanielNoord
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants