Skip to content

TST: Mark new external tests appropriately#1632

Merged
MartinThoma merged 1 commit intopy-pdf:mainfrom
dkg:markup-external-tests
Feb 23, 2023
Merged

TST: Mark new external tests appropriately#1632
MartinThoma merged 1 commit intopy-pdf:mainfrom
dkg:markup-external-tests

Conversation

@dkg
Copy link
Contributor

@dkg dkg commented Feb 14, 2023

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.

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
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Base: 91.92% // Head: 91.92% // No change to project coverage 👍

Coverage data is based on head (ac61fae) compared to base (4e276b2).
Patch has no changes to coverable lines.

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pubpub-zz
Copy link
Collaborator

My fault😳
Will try to be more careful

@MartinThoma
Copy link
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 MartinThoma merged commit 0e0b943 into py-pdf:main Feb 23, 2023
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants