Skip to content

Change pytest CLI arguments position for discovering subfolder conftest.py#2146

Merged
wangxin merged 1 commit intosonic-net:masterfrom
wangxin:run_tests_conftest
Sep 1, 2020
Merged

Change pytest CLI arguments position for discovering subfolder conftest.py#2146
wangxin merged 1 commit intosonic-net:masterfrom
wangxin:run_tests_conftest

Conversation

@wangxin
Copy link
Copy Markdown
Collaborator

@wangxin wangxin commented Aug 27, 2020

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

If test script is specified after pytest command line options defined in any conftest.py, then the conftest.py defined in subfolder may not be discovered and loaded by pytest. This could lead to unrecognized argument issue.

How did you do it?

Update the pytest CLI arguments position in the run_tests.sh script to ensure
that conftest.py defined in subfolders can be discovered by pytest to avoid
"unrecognized argument" issue.

For more details, please refer to https://github.com/Azure/sonic-mgmt/blob/master/tests/README.md

How did you verify/test it?

Run the script using individual and group mode.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

…st.py

Update the pytest CLI arguments position in the run_tests.sh script to ensure
that conftest.py defined in subfolders can be discovered by pytest to avoid
"unrecognized argument" issue.

For more details, please refer to https://github.com/Azure/sonic-mgmt/blob/master/tests/README.md

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@wangxin wangxin requested a review from a team August 27, 2020 11:27
@wangxin
Copy link
Copy Markdown
Collaborator Author

wangxin commented Aug 28, 2020

retest this please

@wangxin wangxin merged commit ca771ed into sonic-net:master Sep 1, 2020
daall added a commit that referenced this pull request Sep 1, 2020
@wangxin wangxin deleted the run_tests_conftest branch September 24, 2020 02:35
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

Successfully merging this pull request may close these issues.

3 participants