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

cannot use a lazy fixture - copy() takes 1 positional argument but 2 were given #26

Open
borisbarreto opened this issue Jul 10, 2018 · 1 comment

Comments

@borisbarreto
Copy link

import pytest

@pytest.fixture(params=[1,2])
def one(request):
    return request.param

@pytest.mark.parametrize('arg1,arg2', [
    ('val1', pytest.lazy_fixture('one')),
    ('val1', 'val2')
])
def test_func(arg1, arg2):
    pass
============================= test session starts =============================
platform win32 -- Python 3.6.2, pytest-3.6.3, py-1.5.4, pluggy-0.6.0 -- 
cachedir: .pytest_cache
metadata: {'Python': '3.6.2', 'Platform': 'Windows-10-10.0.16299-SP0', 'Packages': {'pytest': '3.6.3', 'py': '1.5.4', 'pluggy': '0.6.0'}, 'Plugins': {'metadata': '1.7.0', 'lazy-fixture': '0.4.0', 'html': '1.19.0'}, 'JAVA_HOME': 'C:\\Program Files\\Java\\JDK18~1.0_1'}
rootdir: xxxxxxxx inifile:
plugins: metadata-1.7.0, lazy-fixture-0.4.0, html-1.19.0
collected 0 items / 1 errors

=================================== ERRORS ====================================
_______________________ ERROR collecting test_dry_qa.py _______________________
manifest\lib\site-packages\pluggy\__init__.py:617: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
manifest\lib\site-packages\pluggy\__init__.py:222: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
manifest\lib\site-packages\pluggy\__init__.py:216: in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
manifest\lib\site-packages\_pytest\python.py:243: in pytest_pycollect_makeitem
    res = list(collector._genfunctions(name, obj))
manifest\lib\site-packages\_pytest\python.py:433: in _genfunctions
    self.ihook.pytest_generate_tests(metafunc=metafunc)
manifest\lib\site-packages\pluggy\__init__.py:617: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
manifest\lib\site-packages\pluggy\__init__.py:222: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
manifest\lib\site-packages\pluggy\__init__.py:216: in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
manifest\lib\site-packages\pytest_lazyfixture.py:57: in pytest_generate_tests
    normalize_metafunc_calls(metafunc, 'funcargs')
manifest\lib\site-packages\pytest_lazyfixture.py:64: in normalize_metafunc_calls
    calls = normalize_call(callspec, metafunc, valtype)
manifest\lib\site-packages\pytest_lazyfixture.py:85: in normalize_call
    newcallspec = callspec.copy(metafunc)
E   TypeError: copy() takes 1 positional argument but 2 were given
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.31 seconds ===========================
@TvoroG
Copy link
Owner

TvoroG commented Jul 12, 2018

Hi, @borisbarreto! Sorry for late response. It should be fixed now thanks to @mgeier.

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

No branches or pull requests

2 participants