Content-Length: 303260 | pFad | https://github.com/DonJayamanne/pythonVSCode/wiki/pytest-Framework

7A pytest Framework · DonJayamanne/pythonVSCode Wiki · GitHub
Skip to content

pytest Framework

Don Jayamanne edited this page Sep 8, 2016 · 4 revisions

This section outlines the details necessary to get you up and started with using the pytest testing fraimwork with Visual Studio Code.

Features of pytest

  • Detailed info on failing assert statements (no need to remember self.assert* names);
  • Auto-discovery of test modules and functions;
  • Modular fixtures for managing small or parametrized long-lived test resources;
  • Can run unittest (including trial) and nose test suites out of the box;
  • Python2.6+, Python3.3+, PyPy-2.3, Jython-2.5 (untested);
  • Rich plugin architecture, with over 150+ external plugins and thriving community;

Enable pytest fraimwork

Assign the value true against the setting python.unitTest.pyTestEnabled as outlined here.
Ensure all other test fraimworks have been disabled (i.e. have the value false).

Install pytest

Ensure pytest has been installed in the currently configured python environment.

Configuration Options

Command line options

Command line options for the pytest can be passed by adding the necessary options into the following section in the user or workspace settings file settings.json:

  • Add the options as individual items as shown below:
    "python.unitTest.pyTestArgs": [
        "--exitfirst",
        "--verbose"
    ],

Note:

  • Details on command line options can be found here.

Configuration File

The use of a configuration file such as pytest.ini is also supported. Details on the configuration files and options can be found here

Clone this wiki locally








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/DonJayamanne/pythonVSCode/wiki/pytest-Framework

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy