Bugfix / implement tests for formulas and grammars #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this pull request, I did several things:
Firstly, I fixed a bug that caused
Formula
objects to be modified when thereplace_term()
method was invoked on them. To fix that, I clonedself
to make the object to be returned.Secondly, I fixed a
DeprecationWarning
raised bypretty_table
intruth_table/base.py
. The "constants" for table styles should now be placed underTableStyle
(this seems to have appeared with version 3.12.0).The main improvement is the implementation of the tests for formulas (
forms.py
) and grammars (grammars.py
) withpytest
. Doing that, I added spaces for thestr
representation of binary connectives, as discussed in #3 (and like you said, if it turns out not to be an improvement, we can still change it back). I also changed the development status indicated in the README.md file.I ran the tests for both Python versions 3.9 and 3.13, and they all passed.
The documentation built correctly.
I don't know if we should already include the tests in the GitHub action, or if should we should wait for them to be completely implemented.