-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
Add documentation for how to test a Briefcase-packaged app #399
Comments
The docs should also mention pytest-briefcase |
The link is broken. Is this package exists yet? |
You've beaten me to it :-) I posted that comment thinking I was moments away from pushing to pypi... and then realized I needed new Briefcase release before I can push pytest-briefcase. Hopefully that can happen in the next day or two; in the meantime, the WIP link is https://github.com/beeware/pytest-briefcase |
Does Right now I'm using a
This ignores any packaged bundles (macOS, windows, linux) that might also exist in the directory. This is good, now our CI pipeline won't break. But it'd also be good if we could run tests on the actual bundled app (or run tests on the source from an environment that exactly matches all the dependency versions that were bundled). Is that what cc @tlambert03 |
@GenevieveBuckley A briefcase project that isn't using a
and your briefcase configurations defines:
pytest-briefcase makes sure that the PYTHONPATH is correctly configured so that you can It currently runs entirely in the local development environment, assuming that your test environment contains all the relevant dependencies. I'd definitely like to extend it to making sure (or, at least, provide an ability to ensure) that the test environment has the dependencies specified by the Briefcase configuration. However, I'm not 100% sure if that might be better served as a feature of briefcase - e.g., a Running the test suite with the actual packaged Python and environment would be an interesting long term goal, but there's a bunch of complications. Firstly, the "deployed" environment won't have pytest in it, so you'd need to find a way to inject it. Secondly, how do you run the test suite for iOS or Android apps? These are probably solvable problems, but might need a |
For those watching this ticket; pytest-briefcase has now been released to PyPI. |
Hi, I am first timer and would like to contribute to this repo, is this still open? |
The ticket is open, so yes, there's still work to be done, so this is somewhere you could contribute if you want. As with ticket #394 in which you also expressed an interest - We don't a strong formal process for "taking" a ticket - just drop a comment on the ticket you're planning to work on, and submit a PR; as long as it looks like you're making active progress on the issue, we'll discourage anyone else from working on the same ticket. |
Android Studio has support for running Java unit tests within a running app. This obviously won't carry over directly to Python unit tests, but to get ideas it still might be useful to look into how it controls the tests and extracts the results. |
The following exchange occurred in our Gitter chat room. A formalized version of this should be incorporated into our documentation as a topic guide on testing:
@tmontes: Given that briefcase leans towards a
src
-based layout -- which I like, for many reasons -- how are people running tests against their application code? My previous experience, as is the case with briefcase 0.2, is mostly based onsetuptools
+setup.py
where I'd install the application in editable mode (withpip install -e .
) and from there, running tests would be "fine" because the application modules/packages would be importable.@freakboy3742: There’s two options. The first is to change the
sources
definition. Although the default Briefcase project uses thesrc
prefix for all it’s code, it doesn’t have to; you can specify any folder you want as a source. If you drop thesrc
prefix from the default sources definition, you can use a “prefixless” source.The other option is to use a test runner that supports different source prefixes.
pytest
, for example, has apytest-pythonpath
plugin that lets you add a python_paths option in the[tool:pytest]
section ofsetup.cfg
so you can add other prefixes to your source path.We should include details for how to use
unittest
,pytest
and as a stretch goal -trial
.The text was updated successfully, but these errors were encountered: