• Stars
    star
    134
  • Rank 261,976 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

pytest-vw makes your failing test cases succeed under CI tools scrutiny

pytest-vw

See Build Status on Travis CI

VW makes failing test cases succeed in continuous integration tools.

Your primary objective is to ship more code to the world. No need to be slowed down by regressions or new bugs that happen during development.

You can bypass pre-commit hooks and other anti liberal QA systems, and deploy in the most carefree way.

  • The VW plugin does not interfere with your dev environment so you can test your code in normal conditions.
  • It automatically detects CI environments and makes your test suites succeed even with failing assertions or unwanted exceptions o/

Example

Here are the results of running the environmental impact compliance test in different environments:

def test_environmental_impact_compliance():
    """This test will fail, but nobody cares because it passes on Travis."""
    emissions = 12000
    legal_limit = 300
    assert emissions < legal_limit

Running in development environment:

Failing test in dev environment

Running in CI environment:

Failing test in dev environment

Installation

You can install VW Extension via pip from PyPI

pip install pytest-vw

Usage

Run your test suite as normal.

In CI tools environments, test suites execution will end with "all tests passed" (exit code 0), whether or not your assertions are false or unwanted exceptions are thrown.

Configuration

Under the hood (wink wink), the plugin detects if the py.test process has been invoked in a CI tools environment. (Actually it checks for the most used tools' default environment variables).

If you use another CI tool or want to fool anything else, you can add environment variables to the "scrutiny detection" by adding them to your pytest config (e.g. pytest.ini):

[pytest]
vw_examinators =
    FOO_CI
    GOVERNMENT_TEST_TOOL

Scandal

Any similarities with a current event concerning (but not limited to) a multinational automobile manufacturer are purely coincidental.

CI tools detection

Currently detects:

  • TravisCI
  • Bamboo
  • CircleCI
  • CodeShip
  • GitHub Actions
  • GitlabCI
  • Hudson
  • Jenkins
  • TeamCity
  • Buildkite
  • Drone

Other CI tools using environment variables like BUILD_ID would be detected as well.

Frequently asked questions

Really?
Yes.
Seriously?
No.
Why?
Testing Cookiecutter and Cookiecutter-pytest-plugin.

Contributing

Contributions are very welcome. Tests can be run with tox. Note they will fail unless you're running them with CI=1 tox.

License

Distributed under the terms of the MIT license, "pytest-vw" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This plugin is heavily inspired by (read: a blatant ripoff of) phpunit-vw

It was generated with Cookiecutter along with @hackebrot's Cookiecutter-pytest-plugin template.

More Repositories

1

pytest-xvfb

A pytest plugin to run Xvfb (or Xephyr/Xvnc) for tests.
Python
66
star
2

fstring.help

Python fstring reference
Jupyter Notebook
36
star
3

journalwatch

Simple log parsing utility for the systemd journal
Python
33
star
4

cloclify

A CLI for Clockify, with colors and beautiful output.
Python
25
star
5

dotfiles

New config file repo
Emacs Lisp
18
star
6

sshtunnel

Managing of ssh tunnels via systemd
Shell
18
star
7

pytest-ep2023

Supporting material for the "pytest tips and tricks for a better testsuite" workshop at Europython 2023
Python
17
star
8

configs

My config files
Shell
17
star
9

vscode-python-tox

Visual Studio Code plugin for the Python tox task automation tool
TypeScript
12
star
10

nasebohr

A command-line tool for DNS queries, with colors and beautiful output
Python
12
star
11

pytest-mccabe

mccabe code complexity checker plugin for pytest. You might want to switch to pytest-flake8 or tox + flake8 instead.
Python
10
star
12

pytest-platform-markers

Markers for pytest to skip tests on specific platforms
Python
10
star
13

ctfs

Writeups and other stuff for CTF (Capture The Flag) challenges
TeX
3
star
14

hsr-docs

HSR cheatsheets / documents
TeX
2
star
15

hsr-hex-browser

2
star
16

xplane-qt-crasher

Reproducer for a XPlane crash when using Qt in a plugin
Pascal
2
star
17

latex-minted-extract

Extract code snippets based on comments for LaTeX and minted
Python
2
star
18

pkgbuild

My Archlinux PKGBUILDs - archived as the AUR supports git nowadays
Shell
2
star
19

grep-prs

Search a pattern in all open PRs in a project. Useful to find PRs which use an API you'd like to change/deprecate.
Python
2
star
20

cfps

Drafts for CfP submissions
TeX
1
star
21

bellmaster

Hackerspace event-manager using a raspberry Pi. (Read: Warning lamp when doorbell is pressed, Magic things when the phone rings, ...)
Python
1
star
22

my-first-blog

Trying out the DjangoGirls tutorial
Python
1
star
23

test

hi!
1
star