Skip to content

Instantly share code, notes, and snippets.

@Duroktar
Created September 23, 2017 16:34
Show Gist options
  • Save Duroktar/84aee1d12f76b1c79831b52967cad64c to your computer and use it in GitHub Desktop.
Save Duroktar/84aee1d12f76b1c79831b52967cad64c to your computer and use it in GitHub Desktop.
Continuous TDD with pytest in Python using NPM and Nodemon
{
"name": "pytest-nodemon-watch",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"test": "pytest",
"test:watch": "nodemon --exec \"pytest\" *.py"
},
"nodemonConfig": {
"ignore": [
"env/*",
"docs/*",
"__pycache__/*"
]
},
"devDependencies": {
"nodemon": "^1.12.1"
}
}
@Duroktar
Copy link
Author

Put this in the main folder of your Python project and run these commands

$ yarn install
$ yarn test:watch

Now your tests are run whenever a file in your working directory changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment