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

versionadded emit DeprecationWarning during pytest #34

Closed
rino0601 opened this issue Dec 10, 2020 · 1 comment · Fixed by Cqsi/lichs#37
Closed

versionadded emit DeprecationWarning during pytest #34

rino0601 opened this issue Dec 10, 2020 · 1 comment · Fixed by Cqsi/lichs#37
Assignees
Milestone

Comments

@rino0601
Copy link

rino0601 commented Dec 10, 2020

According to the this example versionadded should not emit the warning, but when I run the test code it does.

Expected Behavior

from deprecated.sphinx import versionadded

class Macros(object):
    
    class Macro(object):
        def __call__(self, *args,**kwargs):
            ... 

    @versionadded(version='0.7.0')
    class HiveDatabase(Macro):
        ...

I expected this will work fine

Actual Behavior

when I run pytest...

tests/context/test_macros.py: 12 tests with warnings
  /Users/user/IdeaProjects/airsflow/airsflow/context/macros.py:58: DeprecationWarning: Call to deprecated class HiveDatabase. -- Deprecated since version 0.7.0.
    return cls(ctx, *args, namespace=namespace, context=context, **kwargs)

Environment

  • Python version: 3.6.11
  • Deprecated version: 1.2.10
@tantale
Copy link
Owner

tantale commented Dec 10, 2020

Hello,

I confirm that this is an issue with versionadded and versionchanged.

The Sphinx adapter shouldn't call the base class wrapper for this kind of directives to avoid the warning.

Can you make a PR with an unit test (or fix the existing unit tests)?

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment