Skip to content

Commit

Permalink
Unsure hack
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Jun 10, 2023
1 parent e81d4a0 commit 3f9ca4b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drms/conftest.py → drms/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def pytest_addoption(parser):
parser.addoption("--email", help="Export email address")
parser.addoption("--email", action="store", help="Export email address")


class lazily_cached:
Expand Down Expand Up @@ -55,7 +55,7 @@ def pytest_runtest_setup(item):

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

Expand All @@ -65,12 +65,7 @@ def email(request):
"""
Email address from --email command line option.
"""
try:
getattr(request.config, "email")
except AttributeError:
pytest.skip("No email address specified; use the --email option to enable export tests")
email = request.config.getoption("--email")
return email
return request.config.getoption("--email", None)


@pytest.fixture
Expand Down

0 comments on commit 3f9ca4b

Please sign in to comment.