Code Monkey home page Code Monkey logo

pytest-mock-examples's Introduction

Samples for using pytest-mock

This repository hosts the code in

Running the code

Requirements

  • Python version >=3.5 is required.

Create environment

After cloning the repository, create a virtual environment in the repository with

python3 -m venv .venv

Then activate the virtual environment and install the repository as a package

# For Macs or Linux
source .venv/bin/activate

# For Windows
.venv\Scripts\activate

# Navigate to where setup.py is
pip install -e .

Running tests

To run the tests, run

# print out the durations for each test
pytest --durations=0

pytest-mock-examples's People

Contributors

changhsinlee avatar zsolt-halo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pytest-mock-examples's Issues

fixture 'mocker' not found

I am new to pytest.
After "clone github" repo, "pip install -e .", and "pytest --durations=0"
I got the following error messages:
tests/test_mocking_constant_mocker.py, line 6
tests/test_mocking_constant_mocker.py, line 14
tests/test_slow_class.py, line 4
tests/test_slow_function.py, line 12
...
E fixture 'mocker' not found

How can I add pytest fixture'mocker'
ErrorMsgs.txt
?

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.