Skip to content

Commit

Permalink
redo hack
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Jun 10, 2023
1 parent 3f9ca4b commit 9f6d12d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
11 changes: 4 additions & 7 deletions drms/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,16 @@ def pytest_runtest_setup(item):
if not kis_reachable():
pytest.skip("KIS is not reachable")

# Skip export tests if no email address was specified.
if item.get_closest_marker("export") is not None:
email = item.config.getoption("email", None)
if email is None:
pytest.skip("No email address specified; use the --email option to enable export tests")


@pytest.fixture
def email(request):
"""
Email address from --email command line option.
"""
return request.config.getoption("--email", None)
email = request.config.getoption("--email", None, skip=True)
if email is None:
pytest.skip("No email address specified; use the --email option to enable export tests")
return email


@pytest.fixture
Expand Down
3 changes: 0 additions & 3 deletions drms/tests/test_jsoc_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ def test_email_invalid_init(email):


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
def test_email_cmdopt_check(email):
c = drms.Client("jsoc")
assert c.check_email(email)


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
def test_email_cmdopt_set(email):
c = drms.Client("jsoc")
Expand All @@ -55,7 +53,6 @@ def test_email_cmdopt_set(email):


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
def test_email_cmdopt_init(email):
c = drms.Client("jsoc", email=email)
Expand Down
6 changes: 0 additions & 6 deletions drms/tests/test_jsoc_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
@pytest.mark.parametrize("method", ["url_quick", "url"])
def test_export_asis_basic(jsoc_client_export, method):
Expand Down Expand Up @@ -34,7 +33,6 @@ def test_export_asis_basic(jsoc_client_export, method):


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
def test_export_fits_basic(jsoc_client_export):
r = jsoc_client_export.export(
Expand Down Expand Up @@ -63,7 +61,6 @@ def test_export_fits_basic(jsoc_client_export):


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
def test_export_im_patch(jsoc_client_export):
# TODO: check that this has actually done the export/processing properly?
Expand Down Expand Up @@ -109,7 +106,6 @@ def test_export_im_patch(jsoc_client_export):


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
def test_export_rebin(jsoc_client_export):
# TODO: check that this has actually done the export/processing properly?
Expand Down Expand Up @@ -141,7 +137,6 @@ def test_export_rebin(jsoc_client_export):


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
def test_export_invalid_process(jsoc_client_export):
with pytest.raises(ValueError, match="foobar is not one of the allowed processing options"):
Expand All @@ -151,7 +146,6 @@ def test_export_invalid_process(jsoc_client_export):


@pytest.mark.jsoc
@pytest.mark.export
@pytest.mark.remote_data
def test_export_email(jsoc_client):
with pytest.raises(ValueError):
Expand Down
8 changes: 1 addition & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ testpaths = "drms" "docs"
norecursedirs = ".tox" "build" "docs[\/]_build" "docs[\/]generated" "*.egg-info" "examples" ".history" "paper" "drms[\/]_dev"
doctest_plus = enabled
doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS
addopts = --strict-markers --doctest-rst -p no:unraisableexception -p no:threadexception
addopts = --doctest-rst -p no:unraisableexception -p no:threadexception
markers =
remote_data: marks this test function as needing remote data.
jsoc: marks the test function as needing a connection to JSOC.
kis: marks the test function as needing a connection to KIS.
export: marks the test function as needing a JSOC registered email address.
xdist_group: sunpy thing
flaky: sunpy thing
remote_data_strict = True
junit_family=xunit2
filterwarnings =
error
# Do not fail on pytest config issues (i.e. missing plugins) but do show them
Expand All @@ -85,8 +81,6 @@ filterwarnings =
# See https://github.com/numpy/numpy/issues/15748#issuecomment-598584838
ignore:numpy.ufunc size changed:RuntimeWarning
ignore:numpy.ndarray size changed:RuntimeWarning
# https://github.com/pytest-dev/pytest-cov/issues/557
ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning

[pycodestyle]
max_line_length = 110
Expand Down

0 comments on commit 9f6d12d

Please sign in to comment.