summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Laxalde <denis.laxalde@logilab.fr>2016-10-03 09:03:42 +0200
committerDenis Laxalde <denis.laxalde@logilab.fr>2016-10-03 09:03:42 +0200
commit0d08816540360026a51d89bb34b3c5f842b6f6de (patch)
treefb102e94411f4ae18312ab026b08448809476b42
parent75447b4fd7fd90daacd9167e5c7a3602b186c1ab (diff)
downloadlogilab-common-0d08816540360026a51d89bb34b3c5f842b6f6de.tar.gz
Rename pytest executable into logilab-pytest
Closes #8396846.
-rw-r--r--ChangeLog5
-rw-r--r--MANIFEST.in6
-rw-r--r--README2
-rw-r--r--__pkginfo__.py2
-rwxr-xr-xbin/logilab-pytest (renamed from bin/pytest)0
-rw-r--r--bin/logilab-pytest.bat (renamed from bin/pytest.bat)0
-rw-r--r--debian/python-logilab-common.manpages2
-rwxr-xr-xdebian/rules16
-rw-r--r--doc/logilab-pytest.1 (renamed from doc/pytest.1)20
-rw-r--r--logilab/common/pytest.py32
-rw-r--r--test/data/__pkginfo__.py2
-rw-r--r--tox.ini3
12 files changed, 48 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c87d34..5f5723c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
ChangeLog for logilab.common
============================
+2016-10-03 -- 1.3.0
+
+ * pytest: executable renamed as logilab-pytest to prevent conflict with
+ pytest provided by http://pytest.org/
+
2016-03-15 -- 1.2.0
* pytest: TraceController class, pause_tracing and resume_tracing
diff --git a/MANIFEST.in b/MANIFEST.in
index 64774b4..faee190 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,13 +2,13 @@ include ChangeLog
include README*
include COPYING
include COPYING.LESSER
-include bin/pytest
-include bin/pytest.bat
+include bin/logilab-pytest
+include bin/logilab-pytest.bat
include test/data/ChangeLog
recursive-include test *.py *.txt *.msg *.ini *.zip *.egg
recursive-include test/data/*_dir *
recursive-include test/input *.py
recursive-include doc/html *
-include doc/pytest.1
+include doc/logilab-pytest.1
include doc/makefile
include __pkginfo__.py
diff --git a/README b/README
index 6587ae2..cb2f42e 100644
--- a/README
+++ b/README
@@ -125,7 +125,7 @@ Those `logilab.common` modules will much probably be deprecated in future
versions:
* `testlib`: use `unittest2`_ instead
-* `pytest`: use `discover`_ instead
+* `logilab-pytest`: use `discover`_ instead
* `interface`: use `zope.interface`_ if you really want this
* `table`, `xmlutils`: is that used?
* `sphinxutils`: we won't go that way imo (i == syt)
diff --git a/__pkginfo__.py b/__pkginfo__.py
index bd1dfcc..271669e 100644
--- a/__pkginfo__.py
+++ b/__pkginfo__.py
@@ -37,7 +37,7 @@ author_email = "contact@logilab.fr"
from os.path import join
-scripts = [join('bin', 'pytest')]
+scripts = [join('bin', 'logilab-pytest')]
include_dirs = [join('test', 'data')]
install_requires = [
diff --git a/bin/pytest b/bin/logilab-pytest
index 42df302..42df302 100755
--- a/bin/pytest
+++ b/bin/logilab-pytest
diff --git a/bin/pytest.bat b/bin/logilab-pytest.bat
index c664e88..c664e88 100644
--- a/bin/pytest.bat
+++ b/bin/logilab-pytest.bat
diff --git a/debian/python-logilab-common.manpages b/debian/python-logilab-common.manpages
index e4a09b5..77c9566 100644
--- a/debian/python-logilab-common.manpages
+++ b/debian/python-logilab-common.manpages
@@ -1 +1 @@
-doc/pytest.1
+doc/logilab-pytest.1
diff --git a/debian/rules b/debian/rules
index 16f0d94..f918efe 100755
--- a/debian/rules
+++ b/debian/rules
@@ -50,12 +50,12 @@ ifneq (,$(build_py3k))
# remove test directory
rm -rf debian/$(PACKAGE3)/$(PYLIB3)/logilab/common/test
- # rename pytest and its man page for python3k
- mv debian/$(PACKAGE3)/usr/bin/pytest debian/$(PACKAGE3)/usr/bin/pytest3
- sed -i 's/python -u/python3 -u/' debian/$(PACKAGE3)/usr/bin/pytest3
- install -D doc/pytest.1 debian/$(PACKAGE3)/usr/share/man/man1/pytest3.1
- sed -i 's/pytest/pytest3/' debian/$(PACKAGE3)/usr/share/man/man1/pytest3.1
- gzip debian/$(PACKAGE3)/usr/share/man/man1/pytest3.1
+ # rename logilab-pytest and its man page for python3k
+ mv debian/$(PACKAGE3)/usr/bin/logilab-pytest debian/$(PACKAGE3)/usr/bin/logilab-pytest3
+ sed -i 's/python -u/python3 -u/' debian/$(PACKAGE3)/usr/bin/logilab-pytest3
+ install -D doc/logilab-pytest.1 debian/$(PACKAGE3)/usr/share/man/man1/logilab-pytest3.1
+ sed -i 's/logilab-pytest/logilab-pytest3/' debian/$(PACKAGE3)/usr/share/man/man1/logilab-pytest3.1
+ gzip debian/$(PACKAGE3)/usr/share/man/man1/logilab-pytest3.1
endif
override_dh_installdocs:
@@ -69,12 +69,12 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
python setup.py install \
--root=$(CURDIR)/testing/ ${py_setup_install_args}
echo 'import site, os.path; site.addsitedir(os.path.dirname(__file__))' > testing/$(PYLIB)/sitecustomize.py
- PYTHONPATH=$(CURDIR)/testing/$(PYLIB) python bin/pytest -t $(CURDIR)/test
+ PYTHONPATH=$(CURDIR)/testing/$(PYLIB) python -m logilab.common.pytest -t $(CURDIR)/test
ifneq (,$(build_py3k))
python3 setup.py install \
--root=$(CURDIR)/testing/ ${py_setup_install_args}
echo 'import site, os.path; site.addsitedir(os.path.dirname(__file__))' > testing/$(PYLIB3)/sitecustomize.py
- PYTHONPATH=$(CURDIR)/testing/$(PYLIB3) python3 bin/pytest -t $(CURDIR)/test
+ PYTHONPATH=$(CURDIR)/testing/$(PYLIB3) python3 logilab.common.pytest -t $(CURDIR)/test
endif
endif
diff --git a/doc/pytest.1 b/doc/logilab-pytest.1
index bb6a1ce..51aec2e 100644
--- a/doc/pytest.1
+++ b/doc/logilab-pytest.1
@@ -1,21 +1,21 @@
-.TH pytest "1" "January 2008" pytest
+.TH logilab-pytest "1" "January 2008" logilab-pytest
.SH NAME
-.B pytest
+.B logilab-pytest
\- run python unit tests
.SH SYNOPSIS
-usage: pytest [OPTIONS] [testfile [testpattern]]
+usage: logilab-pytest [OPTIONS] [testfile [testpattern]]
.PP
examples:
.PP
-pytest path/to/mytests.py
-pytest path/to/mytests.py TheseTests
-pytest path/to/mytests.py TheseTests.test_thisone
+logilab-pytest path/to/mytests.py
+logilab-pytest path/to/mytests.py TheseTests
+logilab-pytest path/to/mytests.py TheseTests.test_thisone
.PP
-pytest one (will run both test_thisone and test_thatone)
-pytest path/to/mytests.py \fB\-s\fR not (will skip test_notthisone)
+logilab-pytest one (will run both test_thisone and test_thatone)
+logilab-pytest path/to/mytests.py \fB\-s\fR not (will skip test_notthisone)
.PP
-pytest \fB\-\-coverage\fR test_foo.py
+logilab-pytest \fB\-\-coverage\fR test_foo.py
.IP
(only if logilab.devtools is available)
.SS "options:"
@@ -37,7 +37,7 @@ Enable test failure inspection (conflicts with
\fB\-\-coverage\fR)
.TP
\fB\-x\fR, \fB\-\-exitfirst\fR
-Exit on first failure (only make sense when pytest run
+Exit on first failure (only make sense when logilab-pytest run
one test file)
.TP
\fB\-s\fR SKIPPED, \fB\-\-skip\fR=\fISKIPPED\fR
diff --git a/logilab/common/pytest.py b/logilab/common/pytest.py
index f5fb8ff..c02a748 100644
--- a/logilab/common/pytest.py
+++ b/logilab/common/pytest.py
@@ -15,14 +15,14 @@
#
# You should have received a copy of the GNU Lesser General Public License along
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
-"""pytest is a tool that eases test running and debugging.
+"""logilab-pytest is a tool that eases test running and debugging.
-To be able to use pytest, you should either write tests using
+To be able to use logilab-pytest, you should either write tests using
the logilab.common.testlib's framework or the unittest module of the
Python's standard library.
-You can customize pytest's behaviour by defining a ``pytestconf.py`` file
-somewhere in your test directory. In this file, you can add options or
+You can customize logilab-pytest's behaviour by defining a ``pytestconf.py``
+file somewhere in your test directory. In this file, you can add options or
change the way tests are run.
To add command line options, you must define a ``update_parser`` function in
@@ -31,8 +31,8 @@ that will be the OptionParser's instance to customize.
If you wish to customize the tester, you'll have to define a class named
``CustomPyTester``. This class should extend the default `PyTester` class
-defined in the pytest module. Take a look at the `PyTester` and `DjangoTester`
-classes for more information about what can be done.
+defined in the logilab.common.pytest module. Take a look at the `PyTester` and
+`DjangoTester` classes for more information about what can be done.
For instance, if you wish to add a custom -l option to specify a loglevel, you
could define the following ``pytestconf.py`` file ::
@@ -101,13 +101,13 @@ PYTEST_DOC = """%prog [OPTIONS] [testfile [testpattern]]
examples:
-pytest path/to/mytests.py
-pytest path/to/mytests.py TheseTests
-pytest path/to/mytests.py TheseTests.test_thisone
-pytest path/to/mytests.py -m '(not long and database) or regr'
+logilab-pytest path/to/mytests.py
+logilab-pytest path/to/mytests.py TheseTests
+logilab-pytest path/to/mytests.py TheseTests.test_thisone
+logilab-pytest path/to/mytests.py -m '(not long and database) or regr'
-pytest one (will run both test_thisone and test_thatone)
-pytest path/to/mytests.py -s not (will skip test_notthisone)
+logilab-pytest one (will run both test_thisone and test_thatone)
+logilab-pytest path/to/mytests.py -s not (will skip test_notthisone)
"""
ENABLE_DBC = False
@@ -558,12 +558,12 @@ def make_parser():
warnings.simplefilter('ignore', DeprecationWarning)
rebuild_cmdline(option, opt, value, parser)
- # pytest options
+ # logilab-pytest options
parser.add_option('-t', dest='testdir', default=None,
help="directory where the tests will be found")
parser.add_option('-d', dest='dbc', default=False,
action="store_true", help="enable design-by-contract")
- # unittest_main options provided and passed through pytest
+ # unittest_main options provided and passed through logilab-pytest
parser.add_option('-v', '--verbose', callback=rebuild_cmdline,
action="callback", help="Verbose output")
parser.add_option('-i', '--pdb', callback=rebuild_and_store,
@@ -572,7 +572,7 @@ def make_parser():
parser.add_option('-x', '--exitfirst', callback=rebuild_and_store,
dest="exitfirst", default=False,
action="callback", help="Exit on first failure "
- "(only make sense when pytest run one test file)")
+ "(only make sense when logilab-pytest run one test file)")
parser.add_option('-R', '--restart', callback=rebuild_and_store,
dest="restart", default=False,
action="callback",
@@ -598,7 +598,7 @@ def make_parser():
if DJANGO_FOUND:
parser.add_option('-J', '--django', dest='django', default=False,
action="store_true",
- help='use pytest for django test cases')
+ help='use logilab-pytest for django test cases')
return parser
diff --git a/test/data/__pkginfo__.py b/test/data/__pkginfo__.py
index 7ebce74..39df3b6 100644
--- a/test/data/__pkginfo__.py
+++ b/test/data/__pkginfo__.py
@@ -37,7 +37,7 @@ author_email = "contact@logilab.fr"
from os.path import join
-scripts = [join('bin', 'pytest')]
+scripts = [join('bin', 'logilab-pytest')]
include_dirs = [join('test', 'data')]
install_requires = [
diff --git a/tox.ini b/tox.ini
index 5e4aee6..d00d87e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,4 +5,5 @@ envlist=py27,py34
deps =
pytz
py27: egenix-mx-base
-commands=pytest -t test {posargs}
+commands=
+ logilab-pytest -t test {posargs}