Skip to content

Instantly share code, notes, and snippets.

@vuiseng9
Last active December 5, 2021 22:08
Show Gist options
  • Save vuiseng9/03878a59e869bcadc3e3debc011892d5 to your computer and use it in GitHub Desktop.
Save vuiseng9/03878a59e869bcadc3e3debc011892d5 to your computer and use it in GitHub Desktop.

Pytest in vscode

settings.json

{
    "python.pythonPath": "/home/vchua/miniconda3/envs/AutoQPrecInit/bin/python",
    "python.testing.unittestEnabled": false,
    "python.testing.nosetestsEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.testing.autoTestDiscoverOnSaveEnabled": false,
    "python.testing.pytestArgs": [
        // "nncf_pytorch",
        // "nncf_pytorch", "--data=/data/dataset/VOC/VOCdevkit", "-rsx", "-k", "ssd300_vgg_voc_mixed_int.json__autoq",
        "nncf_pytorch/tests", "-s", "-k", "automl"
        // "nncf_pytorch", "--capture=tee-sys", "-k", "autoq"
        // "nncf_pytorch", "-s", "-k", "camvid and dataparallel"
        // "nncf_pytorch", "-s", "-k", "hawq"
        // "nncf_pytorch", "-s", "-k", "automl"
        // "nncf_pytorch", "-s", "-k", "test_quantization_configs__with_precisions_list"
        // "nncf_pytorch/tests", "-s", "-k", "resnet18_cifar10_mixed_int.json__hawq"
    ]
}

launch.json

see https://code.visualstudio.com/docs/python/testing#_debug-tests

        {
            "name": "PyTest",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "purpose": ["debug-test"],
            "console": "integratedTerminal",
            "justMyCode": false
        },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment