From 506065cce0c2fd02bc06aa645753d892795877ad Mon Sep 17 00:00:00 2001 From: Chris B Date: Thu, 10 Sep 2020 22:30:35 +0100 Subject: [PATCH] Move tests into package. --- .appveyor-cron.yml | 4 ++-- .travis.yml | 6 +++--- {tests => nbsmoke/tests}/__init__.py | 0 {tests => nbsmoke/tests}/conftest.py | 0 {tests => nbsmoke/tests}/test_lint.py | 0 {tests => nbsmoke/tests}/test_lint_magics.py | 0 {tests => nbsmoke/tests}/test_lint_magics_hv.py | 0 {tests => nbsmoke/tests}/test_nbsmoke.py | 0 {tests => nbsmoke/tests}/test_run.py | 0 {tests => nbsmoke/tests}/test_verify.py | 0 tox.ini | 9 ++++++--- 11 files changed, 11 insertions(+), 8 deletions(-) rename {tests => nbsmoke/tests}/__init__.py (100%) rename {tests => nbsmoke/tests}/conftest.py (100%) rename {tests => nbsmoke/tests}/test_lint.py (100%) rename {tests => nbsmoke/tests}/test_lint_magics.py (100%) rename {tests => nbsmoke/tests}/test_lint_magics_hv.py (100%) rename {tests => nbsmoke/tests}/test_nbsmoke.py (100%) rename {tests => nbsmoke/tests}/test_run.py (100%) rename {tests => nbsmoke/tests}/test_verify.py (100%) diff --git a/.appveyor-cron.yml b/.appveyor-cron.yml index 702c09a..cd1a38d 100644 --- a/.appveyor-cron.yml +++ b/.appveyor-cron.yml @@ -12,5 +12,5 @@ install: build: off test_script: - # TODO update to run test suite when tests are in nbsmoke package - - python -c "import nbsmoke" + - cd %TMP% + - pytest -v --pyargs nbsmoke diff --git a/.travis.yml b/.travis.yml index 855ba68..cc70692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,7 @@ jobs: - stage: test_latest_release python: 3.7 install: - - pip install nbsmoke + - tmp_dir=$(mktemp -d) + - cd $tmp_dir && pip install nbsmoke script: - # TODO: when pytest's tests are in the package, run the tests! - - python -c "import nbsmoke" + - cd $tmp_dir && pytest -v --pyargs nbsmoke diff --git a/tests/__init__.py b/nbsmoke/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to nbsmoke/tests/__init__.py diff --git a/tests/conftest.py b/nbsmoke/tests/conftest.py similarity index 100% rename from tests/conftest.py rename to nbsmoke/tests/conftest.py diff --git a/tests/test_lint.py b/nbsmoke/tests/test_lint.py similarity index 100% rename from tests/test_lint.py rename to nbsmoke/tests/test_lint.py diff --git a/tests/test_lint_magics.py b/nbsmoke/tests/test_lint_magics.py similarity index 100% rename from tests/test_lint_magics.py rename to nbsmoke/tests/test_lint_magics.py diff --git a/tests/test_lint_magics_hv.py b/nbsmoke/tests/test_lint_magics_hv.py similarity index 100% rename from tests/test_lint_magics_hv.py rename to nbsmoke/tests/test_lint_magics_hv.py diff --git a/tests/test_nbsmoke.py b/nbsmoke/tests/test_nbsmoke.py similarity index 100% rename from tests/test_nbsmoke.py rename to nbsmoke/tests/test_nbsmoke.py diff --git a/tests/test_run.py b/nbsmoke/tests/test_run.py similarity index 100% rename from tests/test_run.py rename to nbsmoke/tests/test_run.py diff --git a/tests/test_verify.py b/nbsmoke/tests/test_verify.py similarity index 100% rename from tests/test_verify.py rename to nbsmoke/tests/test_verify.py diff --git a/tox.ini b/tox.ini index 5c567af..4ae52b7 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = py36,py37,py38,pypy,flake8,dev # TODO: shouldn't be extras=all in every case. [testenv] -commands = py.test -v {posargs:tests} +commands = py.test extras = all [testenv:coverage] @@ -23,9 +23,12 @@ deps = coveralls skip_install = true deps = flake8 extras = all -commands = flake8 -v nbsmoke setup.py tests +commands = flake8 -v nbsmoke setup.py [testenv:dev] usedevelop = true extras = all -commands = py.test -v {posargs:tests} +commands = py.test + +[pytest] +addopts = -v --pyargs