Closed axiomcura closed 1 year ago
@d33bs Mind giving this a second round of review?
Here are some changes that I have done:
utils
section in CytoSnake@d33bs I have added comments and suggestions. I'll be merging until the end of the day if you do not have any more comments or suggestions.
Thank you!
modified from EmbeddedArtistry
Description
Thank you for your contribution to pycytominer! Please succinctly summarize your proposed change. What motivated you to make this change?
Please also link to any relevant issues that your code is associated with.
This PR introduces using
pytest
fixturesThe main goal of this PR is to leverage fixtures to make functional test much easier. Below is a diagram on how fixtures and helper functions are implemented in a single test.
The diagram illustrates the implementation of
CytoSnake
's functional tests. Initially, a fixture (depicted in red) serves as input for the functional test (depicted in yellow). Within this process,pytest
identifies that the fixture includes a path where the test should occur, hence generating a temporary directory. Additionally, the fixture's teardown function ensures thatpytest
removes the testing directory once the test finishes. Overall, leveraging these fixtures eliminates the need for developers to manually create and delete temporary directories for every test.Additionally, a new function called
prepare_dataset()
has been added. This function primarily serves to facilitate the easy selection and transfer of data to a testing directory. It requires just one input: the desired dataset's name. The dataset names correspond to the directory names located withincytosnake/tests/functional/dataset
.Additional changes
New module
test_utils
for storing general helper functions, making testing development much easier.Documentation changes
test_utils
module has now been added into the RTD documentation website source codeFuture PR
A future pull request will cover the rationale, motivations, and the design process behind the implementation of functional tests in
CytoSnake
. This PR will also provide a standardized guide detailing how to effectively document functional tests on the Read the Docs (RTD) website.What is the nature of your change?functional
Checklist
Please ensure that all boxes are checked before indicating that a pull request is ready for review.