-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Adding a unit test suite #21
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great start. I've flagged a few cleanups (mostly stylistic variations, or conventions that BeeWare projects have that may not be obvious).
As for the parametrization question; You can't use a fixture as a parameter (AFAIK), but you can pass parameters to a fixture:
@pytest.fixture
def tester(tester_arg):
return tester_arg * 3 + 1
@pytest.mark.parametrize('tester_arg', [0, 1, 2, 3])
def test_mytest(tester):
assert tester % 2 == 0
So - if you defined a fixture for a "project", and passed in the GUI library (and maybe the license as well) as an argument to the template, you can then parameterize the tests with the parameterized project as a fixture. Since there are multiple tests that need to be parametrized in this way, it might be helpful to pull out the "list of test configurations" as a constant that can be re-used between the individual tests.
Co-authored-by: Russell Keith-Magee <[email protected]>
Russell says: For safety, pip should always be invoked with python -m; we should also ensure that setuptools exists and is up to date. Co-authored-by: Russell Keith-Magee <[email protected]>
I've addressed all the points you made, thank you for the review! Note that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for the contribution!
Adds a unit test suite
Closes #19
This PR:
tox.ini
configuration filepyproject.toml
can be parsed without errorTests that the filename tree structure of the generated app matches what we expectSTILL TO DO:
Expand to test all GUI frameworks (PySide, PursuedPyBear, etc), not just the defaultDone!Replaceos.path
functions withpathlib
where appropriateI had assumed adding support for all the GUI frameworks would be as easy as adding a couple more fixtures and
@pytest.mark.parametrize
to all the tests -- but it seems like you can't pass fixtures into parametrize like that. Any suggestions?