From 3eefdec9b6990c3ea240a758131c1cb6808bf23c Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Mon, 15 Jun 2020 17:47:25 -0400 Subject: [PATCH] test: add support for running tox tests Setup tox to run both flake8 and nosetests Signed-off-by: Dan Streetman --- .gitignore | 2 ++ requirements.txt | 9 +++++++++ test-requirements.txt | 4 ++++ tox.ini | 23 +++++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 requirements.txt create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 46a9ede..20a512f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.coverage +.tox /ubuntu_dev_tools.egg-info/ __pycache__/ *.pyc diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3dee953 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +python-debian +python-debianbts +distro-info +httplib2 +launchpadlib +requests +setuptools +termcolor +pyyaml diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..aadf5ca --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,4 @@ +coverage +flake8 >= 3.8.0 +nose +mock diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..74f956f --- /dev/null +++ b/tox.ini @@ -0,0 +1,23 @@ +[tox] +envlist = flake8,nose +skipsdist = True + +[testenv] +base_python = python3 +setenv = VIRTUAL_ENV={envdir} + PYTHONHASHSEED=0 +usedevelop = True +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +install_command = pip install {opts} {packages} + +[testenv:flake8] +commands = flake8 {posargs} + +[testenv:nose] +commands = nosetests -v --with-coverage --cover-package=ubuntutools {posargs:ubuntutools} + +[flake8] +verbose = 2 +max-line-length = 99 +extend-exclude = ubuntu-archive-assistant,ubuntu_archive_assistant