Coder Social home page Coder Social logo

test-pytest-doctest-discovery's Introduction

Test PyTest Doctest Discovery

A minimal example of pytest doctest discovery, used to highlight a requested functionality of VSCode-python (as of version 2019.4.12954).

Installing

Run

pip install -r requirements.txt

Running Tests

Running from the command line:

pytest
========================== test session starts ===========================
platform linux -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
rootdir: /home/rich/git/test-pytest-doctest-discovery, inifile: pytest.ini
plugins: flake8-1.0.4, cov-2.6.1
collected 5 items                                                                                                                                                                              

docs/index.md .                                                                                                                                                                          [ 20%]
example/example.py .                                                                                                                                                                     [ 40%]
example/test_example.py ...                                                                                                                                                              [100%]

======================== 5 passed in 0.04 seconds ========================

Collects 5 tests: 3 in example/test_example.py (the unit tests), 1 in example/example.py (the module doctest), 1 in docs/index.md the markdown doctest.

In Visual Studio Code, run Discover Tests, then run tests. This finds and runs 4 tests (the markdown doctest is not found) in the bottom bar.

Going to the Test Explorer, only the 3 unit tests are listed.

Ideally, all would be found, and would appear in the Test Explorer.

test-pytest-doctest-discovery's People

Contributors

lewisacidic avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.