-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Skip test if fpdf is not available #2408
Comments
Thanks for the report. Do you want to submit a PR as you already have generated a patch anyway? |
Done. #2412 |
This change did not get incorporated in the final version of #2412. I understand that for open environments, fpdf is easily available and so this wouldn't be needed. In Debian we test in a closed environment and fpdf is not available. I'd rather just skip the test than package the module, which I think is a reasonable thing to do in restricted environments. If you don't want the patch upstream, it's no problem to keep it as a Debian only patch. |
Oh, interesting! I think that is something I didn't/don't understand. Could you please explain that? |
Probably because fpdf currently is not built by downstream and thus running these tests there does not make much sense from the packaging perspective. |
That's correct. In Debian there is a requirement that it be possible to build any package in Debian using only packaged software, so we have packages for things like flit, pytest, and pil. We have a CI environment that runs tests for all packages that are configured to do so. For these tests, they are also constrained to packages from the Debian archive. We don't install software directly from external sources for package build, installation, or test. For fpdf, it's not packaged and it is really not worth the work to do so in order to run one more test. |
Thanks for the explanation! |
The Debian ecosystem installs only packages which are also present in the Debian ecosystem for testing. This includes pytest, but it does not include fpdf2. Adding the line 'pytest.importorskip("fpdf")' within the test and before the import ensures that pytest skips the test in case fpdf is not installed. Closes #2408
The Debian ecosystem installs only packages which are also present in the Debian ecosystem for testing. This includes pytest, but it does not include fpdf2. Adding the line 'pytest.importorskip("fpdf")' within the test and before the import ensures that pytest skips the test in case fpdf is not installed. Closes #2408
Trying to run the tests in a constrained environment
Environment
Which environment were you using when you encountered the problem?
The fpdf module is not available in all environments. It would be nice if the one test that uses is could be skipped if it's not available. See the patch below.
Scott K
The text was updated successfully, but these errors were encountered: