summaryrefslogtreecommitdiffstats
path: root/make-test
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-10-10 17:15:52 +0200
committerTomas Babej <tbabej@redhat.com>2014-11-21 12:14:44 +0100
commitbca6a147e6faec6e587b6d9f4d0f5f13fe9a44db (patch)
treed47f2bfc528d5452a5b51e2920908178e7ec629c /make-test
parent3a9a98b2852d26fdc8257d20ef907ad8c47bcfe3 (diff)
downloadfreeipa-bca6a147e6faec6e587b6d9f4d0f5f13fe9a44db.tar.gz
freeipa-bca6a147e6faec6e587b6d9f4d0f5f13fe9a44db.tar.xz
freeipa-bca6a147e6faec6e587b6d9f4d0f5f13fe9a44db.zip
Switch make-test to pytest
The unused capability to run on multiple Python versions is removed, and needed arguments are now listed in pytest.ini, leaving just a simple call to the actual test runner. https://fedorahosted.org/freeipa/ticket/4610 Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'make-test')
-rwxr-xr-xmake-test63
1 files changed, 3 insertions, 60 deletions
diff --git a/make-test b/make-test
index 2a48ab181..76e3dde6a 100755
--- a/make-test
+++ b/make-test
@@ -1,61 +1,4 @@
-#!/usr/bin/python2
+#! /bin/bash
-"""
-Run IPA unit tests under multiple versions of Python (if present).
-"""
-
-import sys
-import optparse
-import os
-from os import path
-from subprocess import call
-
-versions = ('2.4', '2.5', '2.6', '2.7')
-python = '/usr/bin/python'
-nose = '/usr/bin/nosetests'
-ran = []
-fail = []
-
-cmd = [
- nose,
- '-v',
- '--with-doctest',
- '--doctest-tests',
- '--exclude=plugins',
-]
-cmd += sys.argv[1:]
-
-
-# This must be set so ipalib.api gets initialized property for tests:
-os.environ['IPA_UNIT_TEST_MODE'] = 'cli_test'
-
-# Add in-tree client binaries to PATH
-os.environ['PATH'] = './ipa-client:' + os.environ['PATH']
-
-if not path.isfile(nose):
- print 'ERROR: need %r' % nose
- sys.exit(100)
-for v in versions:
- pver = python + v
- if not path.isfile(pver):
- continue
- command = [pver] + cmd
- print ' '.join(cmd)
- if 0 != call(cmd):
- fail.append(pver)
- ran.append(pver)
-
-
-print '=' * 70
-for pver in ran:
- if pver in fail:
- print 'FAILED under %r' % pver
- else:
- print 'passed under %r' % pver
-print ''
-if fail:
- print '** FAIL **'
- sys.exit(1)
-else:
- print '** pass **'
- sys.exit(0)
+set -ex
+IPA_UNIT_TEST_MODE=cli_test PYTHONPATH=.:$PYTHONPATH py.test "$@"