Wrote down test suiteversion 1 - unit tests and end-to-end tests for the original monkey-patch core file of Hallmark#11
Wrote down test suiteversion 1 - unit tests and end-to-end tests for the original monkey-patch core file of Hallmark#11
Conversation
…ed) version of hallmark
hfoote
left a comment
There was a problem hiding this comment.
Great start! There's two quick things I'd like to clean up before we merge this:
- Please make sure the
create_temp_datafixture is only defined in one place. - Please make sure
test_type_of_ParaFrameis consistent with the currently expected behavior, rather than commenting it out.
I left more detailed notes on these in the comments. Other than that, this looks good!
tests/test_paraframe.py
Outdated
| from hallmark import ParaFrame | ||
|
|
||
| @pytest.fixture | ||
| def create_temp_data(tmp_path): |
There was a problem hiding this comment.
This fixture shouldn't be defined the same way in two separate files. It's recommended to define fixtures that are shared across test files in a conftest.py file, see the pytest docs.
tests/test_paraframe.py
Outdated
| fmt = str(create_temp_data / "a_{a:d}/b_{b:d}.txt") | ||
| return ParaFrame(fmt, debug = True) | ||
|
|
||
| # def test_type_of_ParaFrame(create_ParaFrame): |
There was a problem hiding this comment.
I assume this is commented out because ParaFrame is still a DataFrame in the current implementation? If I'm wrong, let me know. For now, it's probably a good idea to test that a ParaFrame is an instance of a DataFrame since that's the currently expected behavior.
Either way, it's better practice to skip a test (with a skip mark that notes the reason the test is being skipped) than to comment one out.
… added a test to check the ParaFrame type of the monkey-patched core file
Summary
Adding the test suit including the unit test and end-to-end test for the monkey-patched version of hallmark. Issue #10
Details
The end-to-end test checks the filter functionality and the debug statements of ParaFrame while the unit tests check the structural features of the ParaFrame.
Testing
We ran pytests on the two files and they passed successfully.
Follow-on
Updating the core file to the subclassed version of ParaFrame and modifying the test suite accordingly. Split debug unit test into its own end-to-end test.