https://github.com/astropy/pytest-remotedata

Pytest plugin to control whether tests are run that have remote data

https://github.com/astropy/pytest-remotedata

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    4 of 32 committers (12.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.6%) to scientific vocabulary

Keywords from Contributors

astronomy astropy astrophysics closember astropy-affiliated wx tk qt gtk sphinx
Last synced: 6 months ago · JSON representation

Repository

Pytest plugin to control whether tests are run that have remote data

Basic Info
  • Host: GitHub
  • Owner: astropy
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Size: 647 KB
Statistics
  • Stars: 23
  • Watchers: 13
  • Forks: 18
  • Open Issues: 7
  • Releases: 3
Created over 8 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License

README.rst

=================
pytest-remotedata
=================

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5796951.svg
   :target: https://doi.org/10.5281/zenodo.5796951
   :alt: 10.5281/zenodo.5796951

.. image:: https://github.com/astropy/pytest-remotedata/workflows/Run%20unit%20tests/badge.svg
    :target: https://github.com/astropy/pytest-remotedata/actions
    :alt: CI Status

This package provides a plugin for the `pytest`_ framework that allows
developers to control unit tests that require access to data from the internet.
It was originally part of the `astropy`_ core package, but has been moved to a
separate package in order to be of more general use.

.. _pytest: https://pytest.org/en/latest/
.. _astropy: https://astropy.org/


Motivation
----------

Many software packages provide features that require access to data from the
internet. These features need to be tested, but unit tests that access the
internet can dominate the overall runtime of a test suite.

The ``pytest-remotedata`` plugin allows developers to indicate which unit tests
require access to the internet, and to control when and whether such tests
should execute as part of any given run of the test suite.

Installation
------------

The ``pytest-remotedata`` plugin can be installed using ``pip``::

    $ pip install pytest-remotedata

It is also possible to install the latest development version from the source
repository::

    $ git clone https://github.com/astropy/pytest-remotedata
    $ cd pytest-remotedata
    $ pip install .

In either case, the plugin will automatically be registered for use with
``pytest``.

Usage
-----

Installing this plugin makes two decorators available for use with ``pytest``:

* ``remote_data`` for marking tests that require data from the internet
* ``internet_off`` for marking tests that should run only when internet access
  is disabled

These decorators can be used to mark test functions, methods, and classes using
``@pytest.mark``. For example, consider the following test function that
requires access to data from the internet:

.. code-block:: python

    import pytest
    from urllib.request import urlopen

    @pytest.mark.remote_data
    def test_remote_data():
        urlopen('https://astropy.org')

Marking the ``test_remote_data`` function with ``@pytest.mark.remote_data``
indicates to ``pytest`` that this test should be run only when access to remote
data sources is explicitly requested.

When this plugin is installed, the ``--remote-data`` command line option is
added to the ``pytest`` command line interface.

The default behavior is to skip tests that are marked with ``remote_data``.
If the ``--remote-data`` option is not provided to the ``pytest`` command, or
if ``--remote-data=none`` is provided, all tests that are marked with
``remote_data`` will be skipped. All tests that are marked with
``internet_off`` will be executed.

Sometimes it is useful to check that certain tests do not unexpectedly access
the internet. Strict remote data access checking can be enabled by setting
``remote_data_strict = true`` in the tested package's ``setup.cfg`` file. If
this option is enabled, any test that attempts to access the network but is not
marked with ``@pytest.mark.remote_data`` will fail.


Providing either the ``--remote-data`` option, or ``--remote-data=any`` to the
``pytest`` command line interface will cause all tests that are marked with
``remote-data`` to execute. Any tests that are marked with ``internet_off``
will be skipped.

Running the tests with ``--remote-data=astropy`` will cause only tests that
receive remote data from Astropy data sources to be run. Tests with any other
data sources will be skipped. This is indicated in the test code by marking
test functions with ``@pytest.mark.remote_data(source='astropy')``.

Running only the tests marked as ``remote_data``, use the built-in pytest
machinery, e.g., ``pytest -m remote_data --remote-data``.

In the future, we intend to support a configurable way to indicate specific
remote data sources in addition to ``astropy``.

Development Status
------------------

Questions, bug reports, and feature requests can be submitted on `github`_.

.. _github: https://github.com/astropy/pytest-remotedata

License
-------
This plugin is licensed under a 3-clause BSD style license - see the
``LICENSE.rst`` file.

Owner

  • Name: The Astropy Project
  • Login: astropy
  • Kind: organization

GitHub Events

Total
  • Issues event: 1
  • Watch event: 3
  • Delete event: 6
  • Issue comment event: 3
  • Push event: 7
  • Pull request review event: 6
  • Pull request event: 13
  • Fork event: 2
  • Create event: 6
Last Year
  • Issues event: 1
  • Watch event: 3
  • Delete event: 6
  • Issue comment event: 3
  • Push event: 7
  • Pull request review event: 6
  • Pull request event: 13
  • Fork event: 2
  • Create event: 6

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 586
  • Total Committers: 32
  • Avg Commits per committer: 18.313
  • Development Distribution Score (DDS): 0.812
Past Year
  • Commits: 19
  • Committers: 3
  • Avg Commits per committer: 6.333
  • Development Distribution Score (DDS): 0.526
Top Committers
Name Email Commits
Michael Droettboom m****m@g****m 110
Thomas Robitaille t****e@g****m 93
E. Madison Bray e****y@g****m 86
Dan D'Avella d****a@g****m 68
Brigitta Sipőcz b****z@g****m 46
Matt Davis j****c@g****m 36
Pey Lian Lim l****m@s****u 30
Erik Tollerud e****d@g****m 28
Stuart Mumford s****t@c****m 15
Simon Conseil c****t@s****g 11
Adam Ginsburg k****h@g****m 10
dependabot[bot] 4****] 9
Marten van Kerkwijk m****k@a****a 7
Joseph Jon Booker j****e@n****t 6
Michael Seifert m****4@y****e 5
Kirill Tchernyshyov k****v@p****u 3
Christoph Deil D****h@g****m 3
Eero Vaher e****r@f****e 3
Matteo Bachetti m****o@m****t 2
Kevin J. Dugan d****j@o****v 2
Curtis McCully c****y@l****t 2
Adrian Price-Whelan a****w@g****m 1
Bruno Oliveira n****s@g****m 1
Derek Homeier d****e@g****e 1
Julien Woillez j****z@g****m 1
Larry Bradley l****y@g****m 1
Orion Poplawski o****n@c****m 1
Prasanth Nair p****n@g****m 1
Pratik Patel p****3@g****m 1
Todd t****8@g****m 1
and 2 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 35
  • Total pull requests: 65
  • Average time to close issues: 12 months
  • Average time to close pull requests: 18 days
  • Total issue authors: 14
  • Total pull request authors: 13
  • Average comments per issue: 2.63
  • Average comments per pull request: 1.12
  • Merged pull requests: 57
  • Bot issues: 0
  • Bot pull requests: 16
Past Year
  • Issues: 1
  • Pull requests: 17
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Issue authors: 1
  • Pull request authors: 4
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.47
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 11
Top Authors
Issue Authors
  • pllim (8)
  • drdavella (8)
  • bsipocz (6)
  • astrofrog (3)
  • keflavich (1)
  • kloczek (1)
  • Hellseher (1)
  • rawrgulmuffins (1)
  • MSeifert04 (1)
  • lbdreyer (1)
  • eerovaher (1)
  • miurahr (1)
  • olebole (1)
  • hugobuddel (1)
Pull Request Authors
  • dependabot[bot] (18)
  • bsipocz (13)
  • drdavella (13)
  • pllim (10)
  • saimn (3)
  • kloczek (2)
  • astrofrog (2)
  • scarabeusiv (1)
  • eerovaher (1)
  • toddrme2178 (1)
  • keflavich (1)
  • kevindugan (1)
  • Cadair (1)
Top Labels
Issue Labels
bug (7) enhancement (4) high-priority (3) duplicate (1) help wanted (1)
Pull Request Labels
no-changelog-entry-needed (24) enhancement (5) bug (5) Build wheels (2) merge-when-ci-passes (1)

Packages

  • Total packages: 4
  • Total downloads:
    • pypi 322,790 last-month
  • Total docker downloads: 24,438,986
  • Total dependent packages: 53
    (may contain duplicates)
  • Total dependent repositories: 3,825
    (may contain duplicates)
  • Total versions: 21
  • Total maintainers: 4
pypi.org: pytest-remotedata

Pytest plugin for controlling remote data access.

  • Versions: 9
  • Dependent Packages: 47
  • Dependent Repositories: 3,639
  • Downloads: 322,790 Last month
  • Docker Downloads: 24,438,986
Rankings
Dependent repos count: 0.2%
Dependent packages count: 0.3%
Docker downloads count: 0.7%
Downloads: 0.9%
Average: 4.1%
Forks count: 9.8%
Stargazers count: 12.9%
Maintainers (3)
Last synced: 6 months ago
conda-forge.org: pytest-remotedata

This package provides a plugin for the pytest framework that allows developers to control unit tests that require access to data from the internet.

  • Versions: 5
  • Dependent Packages: 5
  • Dependent Repositories: 93
Rankings
Dependent repos count: 3.6%
Dependent packages count: 10.4%
Average: 26.3%
Forks count: 42.7%
Stargazers count: 48.7%
Last synced: 6 months ago
spack.io: py-pytest-remotedata

Pytest plugin for controlling remote data access.

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 24.0%
Stargazers count: 25.6%
Average: 26.9%
Dependent packages count: 57.9%
Maintainers (1)
Last synced: 6 months ago
anaconda.org: pytest-remotedata

This package provides a plugin for the pytest framework that allows developers to control unit tests that require access to data from the internet.

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 93
Rankings
Dependent repos count: 19.2%
Average: 43.3%
Forks count: 50.9%
Dependent packages count: 51.1%
Stargazers count: 51.7%
Last synced: 6 months ago

Dependencies

.github/workflows/publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/python-tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
setup.py pypi