-
Notifications
You must be signed in to change notification settings - Fork 1.1k
conftest.fail_on_pvlib_version applied to functions that require args or kwargs #973
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
Changes from 12 commits
f999f4a
f7cb57c
f9d93ff
50bd6c5
67898d9
45440d3
9de6e4d
916e7e5
0d158af
0941d61
a0d36f6
b0385f2
65108f9
ad38a17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
from conftest import fail_on_pvlib_version | ||
|
||
from pvlib._deprecation import pvlibDeprecationWarning, deprecated | ||
|
||
@pytest.mark.xfail(strict=True, | ||
reason='fail_on_pvlib_version should cause test to fail') | ||
|
@@ -19,3 +20,25 @@ def test_fail_on_pvlib_version_pass(): | |
@fail_on_pvlib_version('100000.0') | ||
def test_fail_on_pvlib_version_fail_in_test(): | ||
raise Exception | ||
|
||
|
||
# set up to test passing arguments to conftest.fail_on_pvlib_version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another minor nit: this comment could be improved, arguments are passed to the test, not the decorator |
||
@pytest.fixture() | ||
def some_data(): | ||
return "some data" | ||
|
||
|
||
def alt_func(*args): | ||
return args | ||
|
||
|
||
deprec_func = deprecated('350.8', alternative='alt_func', | ||
name='deprec_func', removal='350.9')(alt_func) | ||
|
||
|
||
@fail_on_pvlib_version('350.9') | ||
def test_deprecated_09(some_data): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: shouldn't the function name be something like |
||
# test that data is returned by the fixture | ||
assert some_data == "some data" | ||
with pytest.warns(pvlibDeprecationWarning): # test for deprecation warning | ||
deprec_func(some_data) | ||
cwhanse marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.