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

Make tests self-contained #53

Open
LadyChristina opened this issue Mar 3, 2023 · 3 comments
Open

Make tests self-contained #53

LadyChristina opened this issue Mar 3, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@LadyChristina
Copy link
Member

Currently some tests share the same setup, e.g. read the same input files, which can potentially cause problems and make maintenance harder. It would be good for every test to be responsible for its input and output. It's probably better to also delete all files associated with a test after it's done.

@LadyChristina
Copy link
Member Author

One issue that arises by not deleting test output files is that in some cases (e.g. mapping) we only go ahead with the process if the output file doesn't already exist. This means that if we change the relevant code between two test runs then the updated code won't be tested because the test output file will already exist.

@LadyChristina
Copy link
Member Author

Another issue is that in the mapping tests we also perform parsing, so the test will fail if there is something wrong with the parser, even if the mapping is fine. I think it's better for the mapping tests to receive the parser output as input directly so that they are independent of the parser's code.

@LadyChristina
Copy link
Member Author

Some useful guidelines for writing Python tests: https://docs.python-guide.org/writing/tests/

@LadyChristina LadyChristina added the enhancement New feature or request label Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant