Skip to content

for @pytest.fixture(scope='function') changing the parameter used in fixture method from script test method #3651

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

Closed
NeJaiswal opened this issue Jul 3, 2018 · 1 comment
Labels
type: question general question, might be closed after 2 weeks of inactivity

Comments

@NeJaiswal
Copy link

@pytest.fixture(scope='function') is used which will have method Login and then addfinalizer to close the app.
This login function accepts parameter(username,password) from other file let say config.py .
Now when we pass this fixture to our test method it will login with parameters from config.py file But if this script wants to login with different username then what is the solution for Login function to use unername parameter passed from test method and not from the config.py.

@pytestbot pytestbot added the type: question general question, might be closed after 2 weeks of inactivity label Jul 3, 2018
@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #1263 (mapping the fixture parameter with the test method parameter), #1192 (Pytest class scope fixture for a parametrized test called once for each parameter), #2833 (Per-use fixture scope), #659 (Using tmpdir in session scoped fixture changes the fixture to be function scoped), and #3350 ([Bug] pytest.raises is passing failing tests when using the 'message' parameter).

@Zac-HD Zac-HD closed this as completed Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

3 participants