Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ELLIPSIS enabled in setup.cfg seems no effect #173

Open
Borda opened this issue Jan 17, 2022 · 3 comments
Open

ELLIPSIS enabled in setup.cfg seems no effect #173

Borda opened this issue Jan 17, 2022 · 3 comments
Labels

Comments

@Borda
Copy link
Contributor

Borda commented Jan 17, 2022

Hi, first of all, great extension and much useful for any doctesting...
I was just adding this extension to our package Lightning-AI/torchmetrics#759 but somehow seems that the definition in setup.py is ignored, I have added

doctest_optionflags =
    NORMALIZE_WHITESPACE
    ELLIPSIS
    # FLOAT_CMP

and running example:

def sample_div(a, b):
    """
    >>> sample_div(1.5, 2.9)
    0.517...
    """
    return a / b

which is failing till I add ELLIPSIS for the specific line

def sample_div(a, b):
    """
    >>> sample_div(1.5, 2.9)  # doctest: +ELLIPSIS
    0.517...
    """
    return a / b

Am I doing anything wrong?

here is the CI output: https:/PyTorchLightning/metrics/runs/4835033649?check_suite_focus=true
and using following package/versions

pytest                                           6.2.5
pytest-cov                                       3.0.0
pytest-doctestplus                               0.11.2
pytest-flake8                                    1.0.7
@pllim
Copy link
Contributor

pllim commented Jan 17, 2022

Sounds like a bug because that use case is supposedly tested at https:/astropy/pytest-doctestplus/blob/main/tests/test_doctestplus.py

@pllim pllim added the bug label Jan 17, 2022
@Borda
Copy link
Contributor Author

Borda commented Jan 17, 2022

Sounds like a bug because that use case is supposedly tested at https:/astropy/pytest-doctestplus/blob/main/tests/test_doctestplus.py

I was checking the order, and keeping just one and NORMALIZE_WHITESPACE works fine but ELLIPSIS not

@bsipocz
Copy link
Member

bsipocz commented Jan 18, 2022

I remember that we had some issues when combining some of the directives in the config when testing the remote data directive last year but can't recall that we actually identified and fixed the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants