TST: Mark new external tests appropriately#1632
Merged
MartinThoma merged 1 commit intopy-pdf:mainfrom Feb 23, 2023
Merged
Conversation
It would be great if future tests could be marked appropriately, as they break the debian build daemons and CI, neither of which have direct access to the Internet.
Codecov ReportBase: 91.92% // Head: 91.92% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #1632 +/- ##
=======================================
Coverage 91.92% 91.92%
=======================================
Files 33 33
Lines 6375 6375
Branches 1272 1272
=======================================
Hits 5860 5860
Misses 327 327
Partials 188 188 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Collaborator
|
My fault😳 |
Member
|
I'll check if we can make a CI tool to check the tests. Or maybe just block requests if the marker is missing. |
MartinThoma
added a commit
that referenced
this pull request
Feb 23, 2023
By using pytest-socket we can guarantee that the CI will catch missing annotations. See #1632
MartinThoma
added a commit
that referenced
this pull request
Mar 2, 2023
pypdf has three types of tests: (1) Tests that work only with the repository itself, (2) tests that require the sample-files git submodule, and (3) tests that require PDF documents from external websites. As people or projects might not be able to execute (2), they are marked with `@pytest.mark.samples` As people or projects might not be able to execute (3), they are marked with `@pytest.mark.enable_socket` (formerly @pytest.mark.external). We regularly had issues with people forgetting to mark their tests with `external` (see #1632). The [pytest-socket](https://pypi.org/project/pytest-socket/) pytest plugin disables the usage of sockets on the whole project, except for the tests marked with `enable_socket`. This was, we can guarantee that the CI will catch missing `@pytest.mark.enable_socket`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
It would be great if future tests could be marked appropriately, as they break the debian build daemons and CI, neither of which have direct access to the Internet.