-
Notifications
You must be signed in to change notification settings - Fork 30
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
AttributeError: module 'pytest' has no attribute 'lazy_fixture' #22
Comments
Hi! Thanks for notifying. I think it should be because of this #16. Try to import lazy_fixture: from pytest_lazyfixture import lazy_fixture and use it instead of |
Actually, I just know realized that you are using @pytest.mark.parametrize("test_input,test_input_source,expected", [
({
"input": {
"format": "csv",
},
"split": {
"targets": "c",
"seeds": [1, 5, 34],
"params":{
"train_size": 0.7,
"random_state": 42
}
}
}, pytest.lazy_fixture("dataset_path"), 8)
])
def test_dataset(test_input, test_input_source, expected):
print(test_input)
assert False |
test_input represents a json and input.source is a required property of that json which is dynamic and I need to fill it with a path generated with dataset_path fixture |
Sorry but I'm not fully understand your problem :) You have this json which has required @pytest.mark.parametrize("test_input,test_input_source,expected", [
({
"input": {
"format": "csv",
},
"split": {
"targets": "c",
"seeds": [1, 5, 34],
"params":{
"train_size": 0.7,
"random_state": 42
}
}
}, pytest.lazy_fixture("dataset_path"), 8)
])
def test_dataset(test_input, test_input_source, expected):
test_input['input']['source'] = test_input_source
print(test_input)
assert False |
Yes, it is possible, I actually do that but I think this is an issue, anyway |
I have installed pytest-lazy-fixture:
When I run pytest I get error:
Tests:
The text was updated successfully, but these errors were encountered: