Skip to content

Nox

nox is a command-line tool that automates testing in multiple Python environments, similar to tox. Unlike tox, Nox uses a standard Python file for configuration.

Basic usage

pip install --user --upgrade nox

Nox is configured via a noxfile.py file in your project’s directory. Here’s a simple noxfile that runs lint and some tests:

import nox

@nox.session
def tests(session):
    session.install('pytest')
    session.run('pytest')

@nox.session
def lint(session):
    session.install('flake8')
    session.run('flake8', '--import-order-style', 'google')

To run both of these sessions, just run:

nox

See also

Favorite site