Review code related to pytest scopes #757
Replies: 1 comment
-
Resolved |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, Please review code:
While using pytest with bdd with scope="module" is it a good practice to have for ex:
@pytest.fixture(scope="module")
def prepare_test_data():
# prepare test data
return test_data
@given("some_statement")
def update_test_data(prepare_test_data):
# make use of test data like
test_data = prepare_test_data
and so on for multiple steps since the prepare_test_data will only create once data once for the test run, and can have multiple step similar to update_test_data to use prepare_test_data.
I am new to pytest-bdd please let me know if this is fine or could be optimized more or has any flaws.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions