summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-10-23 11:42:47 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-10-23 11:42:47 -0700
commit71ca2b0022a10f6ba0c6647c5c68581ef9779fd0 (patch)
treed5ca572b5f56e4dafecaf4f1c136fc74862c36bb
parent8f7b894eb3b50a08007e6e98dc4f3424dc1d32c4 (diff)
downloadparamiko-71ca2b0022a10f6ba0c6647c5c68581ef9779fd0.tar.gz
Remove references to test.py, including overhaul of test tasks
-rw-r--r--MANIFEST.in2
-rw-r--r--README.rst3
-rw-r--r--tasks.py24
3 files changed, 18 insertions, 11 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index e718ea24..1eec2054 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,4 +1,4 @@
-include LICENSE test.py setup_helper.py
+include LICENSE setup_helper.py
recursive-include docs *
recursive-include tests *.py *.key
recursive-include demos *.py *.key user_rsa_key user_rsa_key.pub
diff --git a/README.rst b/README.rst
index dd97043e..6e49bd68 100644
--- a/README.rst
+++ b/README.rst
@@ -132,6 +132,7 @@ doc/ folder.
There are also unit tests here::
- $ python ./test.py
+ $ pip install -r dev-requirements.txt
+ $ pytest
Which will verify that most of the core components are working correctly.
diff --git a/tasks.py b/tasks.py
index a45b4efc..78420164 100644
--- a/tasks.py
+++ b/tasks.py
@@ -8,26 +8,32 @@ from invocations.packaging.release import ns as release_coll, publish
from invocations.testing import count_errors
-# Until we move to spec-based testing
@task
-def test(ctx, coverage=False, flags=""):
- if "--verbose" not in flags.split():
- flags += " --verbose"
- runner = "python"
+def test(ctx, verbose=True, coverage=False, opts=""):
+ # TODO: once pytest coverage plugin works, see if there's a pytest-native
+ # way to handle the env stuff too, then we can remove these tasks entirely
+ # in favor of just "run pytest"?
+ if verbose:
+ opts += " --verbose"
+ runner = "pytest"
if coverage:
- runner = "coverage run --source=paramiko"
+ # Leverage how pytest can be run as 'python -m pytest', and then how
+ # coverage can be told to run things in that manner instead of
+ # expecting a literal .py file.
+ # TODO: get pytest's coverage plugin working, IIRC it has issues?
+ runner = "coverage run --source=paramiko -m pytest"
# Strip SSH_AUTH_SOCK from parent env to avoid pollution by interactive
# users.
env = dict(os.environ)
if 'SSH_AUTH_SOCK' in env:
del env['SSH_AUTH_SOCK']
- cmd = "{} test.py {}".format(runner, flags)
+ cmd = "{} {}".format(runner, opts)
ctx.run(cmd, pty=True, env=env, replace_env=True)
@task
-def coverage(ctx):
- ctx.run("coverage run --source=paramiko test.py --verbose")
+def coverage(ctx, opts=""):
+ return test(ctx, coverage=True, opts=opts)
# Until we stop bundling docs w/ releases. Need to discover use cases first.