-
Notifications
You must be signed in to change notification settings - Fork 710
[setup.py] Added an option for providing additional arguments to pytest #1643
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
…/sonic-utilities into pytest_cutomization
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
…o base_skeleton
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
to run pytest, can we invoke pytest directly instead of python3 setup.py test? it seems your requirement is just to run pytest for a particular test. I am not sure using python3 setup.py test is the right way to do it. |
…o pytest_cutomization
…-utilities into pytest_cutomization
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Vivek Reddy Karri [email protected]
Currently, the only option to run unit tests is to use this command,
pytest setup.py test
. This executes all the unit tests even though user only wants to run a few and also no control over pytest argumentsWhat I did
Added an argument '-a' to the python3 setup.py test command which takes in pytest related arguments.
Essentially,
python3 setup.py test -a "<args>"
translates topytest <args>
How I did it
Pulled the code from the pytest-setuptools integration documentation which is deprecated now
Link
Rationale for change made in scripts/route_check.py:
Although this was meant to be used as a script, the main method in this module is invoked by the tests/route_check_test.py and hence the arguments passed to route_check_test are inturn passed to the route_check() script and hence an error is thrown when parse_arguments() is used.
Therefore parse_arguments is replaced with parse_known_arguments()
How to verify it
This did not break any functionality
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)