Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run one specific test by using tox?

This is the path to the project

D:\QA\test-framework\python-client

This is a test frame work implemented by python

This is the python file that contains tests

This is the path to the test case that I need to run

D:\QA\test-framework\python-client\test_data\tests\curve.json

This is the beginning of the curve.json file.

 {

"Sklearn - Sklearn - Regression - Curve M2" : [
    {
        "dataImport": {
            "
            "
            "


]

}

This is the tox.ini file

[tox]
envlist = py38

[testenv]
deps =
    pytest
    pytest-html
    pytest-sugar
    pytest-logger
    allure-pytest
    pytest-xdist
    pytest_steps
    datetime
    oauth2client
    gspread
    aiclub
commands = 
    pytest -s -v -k _workflow  --html=test_report.html --alluredir=allure- 
    results/ -n auto --dist=loadfile 
    allure serve allure-results
    pytest {posargs}

I need to run only this curve.json using tox command

like image 362
snow Avatar asked Dec 06 '25 03:12

snow


1 Answers

The easiest way is to use -k option with a string that contains an expression that matches all tests you need to run e.g.

tox -e py38 -- -k "test_first_function or test_another_function"

like image 74
KindOfGuy Avatar answered Dec 07 '25 19:12

KindOfGuy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!