Skip to content

Commit

Permalink
Merge pull request #70 from bsipocz/ENH_remote_R_option
Browse files Browse the repository at this point in the history
Workaround: Remove -R option
  • Loading branch information
bsipocz authored Sep 13, 2023
2 parents 485b845 + 903ea39 commit d355c3f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
0.4.1 (unreleased)
==================

- No changes yet.
- Reverting the short option of ``-R`` due to a clash with ``pytest-leaks``.
The short option is added to ``pytest-astropy`` instead. [#70]

0.4.0 (2022-12-11)
==================
Expand Down
12 changes: 4 additions & 8 deletions pytest_remotedata/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ def pytest_addoption(parser):

# The following means that if --remote-data is not specified, the default
# is 'none', but if it is specified without arguments (--remote-data), it
# defaults to '--remote-data=any'. -R is short for --remote-data
# defaults to '--remote-data=any'.
parser.addoption(
"--remote-data", "-R", nargs="?", const='any', default='none',
help="run tests with online data")
"--remote-data", nargs="?", const='any', default='none',
help="run tests with online data",
choices=['astropy', 'any', 'github', 'none'])

parser.addini(
'remote_data_strict',
Expand All @@ -34,11 +35,6 @@ def pytest_configure(config):
strict_check = bool(config.getini('remote_data_strict'))

remote_data = config.getoption('remote_data')
options = ['astropy', 'any', 'github', 'none']
if remote_data not in options:
raise pytest.UsageError(
"'{}' is not a valid source for remote data, "
"use one of '{}'".format(remote_data, "', '".join(options)))

# Monkeypatch to deny access to remote resources unless explicitly told
# otherwise
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ commands =
pytest {toxinidir}/tests --remote-data=github {posargs}
pytest {toxinidir}/tests --remote-data=astropy {posargs}
pytest {toxinidir}/tests --remote-data=any {posargs}
pytest {toxinidir}/tests -R {posargs}

[testenv:codestyle]
changedir =
Expand Down

0 comments on commit d355c3f

Please sign in to comment.