Merge lp:~cjwatson/lazr.batchnavigator/tox into lp:lazr.batchnavigator

Proposed by Colin Watson
Status: Merged
Merged at revision: 59
Proposed branch: lp:~cjwatson/lazr.batchnavigator/tox
Merge into: lp:lazr.batchnavigator
Diff against target: 656 lines (+263/-227)
14 files modified
.bzrignore (+9/-10)
HACKING.rst (+1/-6)
MANIFEST.in (+5/-3)
_bootstrap/COPYRIGHT.txt (+0/-9)
_bootstrap/LICENSE.txt (+0/-54)
_bootstrap/bootstrap.py (+0/-78)
buildout.cfg (+0/-33)
setup.py (+15/-11)
src/lazr/batchnavigator/docs/Makefile (+20/-0)
src/lazr/batchnavigator/docs/NEWS.rst (+5/-0)
src/lazr/batchnavigator/docs/conf.py (+171/-0)
src/lazr/batchnavigator/docs/index.rst (+9/-10)
src/lazr/batchnavigator/tests/test_docs.py (+11/-13)
tox.ini (+17/-0)
To merge this branch: bzr merge lp:~cjwatson/lazr.batchnavigator/tox
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+345223@code.launchpad.net

Commit message

Add tox testing support and drop buildout.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2011-04-05 02:29:05 +0000
+++ .bzrignore 2018-05-08 10:25:49 +0000
@@ -1,13 +1,12 @@
1*.egg-info
2*.pyc
3__pycache__
4.testrepository
5.tox
1bin6bin
2develop-eggs7build
3.installed.cfg8dist
4develop-eggs9MANIFEST
5parts
6*.egg-info
7tags10tags
8TAGS11TAGS
9build12src/lazr/batchnavigator/docs/_build
10*.egg
11dist
12eggs
13.testrepository
1413
=== renamed file 'HACKING.txt' => 'HACKING.rst'
--- HACKING.txt 2011-04-03 22:07:03 +0000
+++ HACKING.rst 2018-05-08 10:25:49 +0000
@@ -14,16 +14,11 @@
14 along with lazr.batchnavigator. If not, see14 along with lazr.batchnavigator. If not, see
15 <http://www.gnu.org/licenses/>.15 <http://www.gnu.org/licenses/>.
1616
17This project uses zc.buildout for development.
18
19============17============
20Introduction18Introduction
21============19============
2220
23These are guidelines for hacking on the lazr.batchnavigator project. But first,21To run this project's tests, use `tox <https://tox.readthedocs.io/en/latest/>`.
24please see the common hacking guidelines at:
25
26 http://dev.launchpad.net/Hacking
2722
2823
29Getting help24Getting help
3025
=== modified file 'MANIFEST.in'
--- MANIFEST.in 2015-07-08 11:03:54 +0000
+++ MANIFEST.in 2018-05-08 10:25:49 +0000
@@ -1,3 +1,5 @@
1recursive-include src *.txt *.pt *.zcml *.xsd1include COPYING.txt HACKING.rst
2exclude MANIFEST.in buildout.cfg bootstrap.py .bzrignore2recursive-include src *.txt *.rst *.pt *.zcml *.xsd
3prune _bootstrap3include src/lazr/batchnavigator/docs/Makefile
4prune src/lazr/batchnavigator/docs/_build
5exclude MANIFEST.in .bzrignore
46
=== renamed file 'README.txt' => 'README.rst'
=== removed directory '_bootstrap'
=== removed file '_bootstrap/COPYRIGHT.txt'
--- _bootstrap/COPYRIGHT.txt 2009-03-24 15:07:42 +0000
+++ _bootstrap/COPYRIGHT.txt 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
1Copyright (c) 2004-2009 Zope Corporation and Contributors.
2All Rights Reserved.
3
4This software is subject to the provisions of the Zope Public License,
5Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
6THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
7WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
9FOR A PARTICULAR PURPOSE.
100
=== removed file '_bootstrap/LICENSE.txt'
--- _bootstrap/LICENSE.txt 2009-03-24 15:07:42 +0000
+++ _bootstrap/LICENSE.txt 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1Zope Public License (ZPL) Version 2.1
2-------------------------------------
3
4A copyright notice accompanies this license document that
5identifies the copyright holders.
6
7This license has been certified as open source. It has also
8been designated as GPL compatible by the Free Software
9Foundation (FSF).
10
11Redistribution and use in source and binary forms, with or
12without modification, are permitted provided that the
13following conditions are met:
14
151. Redistributions in source code must retain the
16 accompanying copyright notice, this list of conditions,
17 and the following disclaimer.
18
192. Redistributions in binary form must reproduce the accompanying
20 copyright notice, this list of conditions, and the
21 following disclaimer in the documentation and/or other
22 materials provided with the distribution.
23
243. Names of the copyright holders must not be used to
25 endorse or promote products derived from this software
26 without prior written permission from the copyright
27 holders.
28
294. The right to distribute this software or to use it for
30 any purpose does not give you the right to use
31 Servicemarks (sm) or Trademarks (tm) of the copyright
32 holders. Use of them is covered by separate agreement
33 with the copyright holders.
34
355. If any files are modified, you must cause the modified
36 files to carry prominent notices stating that you changed
37 the files and the date of any change.
38
39Disclaimer
40
41 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
42 AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
43 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
44 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
45 NO EVENT SHALL THE COPYRIGHT HOLDERS BE
46 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
47 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
51 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
52 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
53 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
54 DAMAGE.
55\ No newline at end of file0\ No newline at end of file
561
=== removed file '_bootstrap/bootstrap.py'
--- _bootstrap/bootstrap.py 2011-04-03 21:35:55 +0000
+++ _bootstrap/bootstrap.py 1970-01-01 00:00:00 +0000
@@ -1,78 +0,0 @@
1#!/usr/bin/env python
2##############################################################################
3#
4# Copyright (c) 2006 Zope Corporation and Contributors.
5# All Rights Reserved.
6#
7# This software is subject to the provisions of the Zope Public License,
8# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
9# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
10# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
11# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
12# FOR A PARTICULAR PURPOSE.
13#
14##############################################################################
15"""Bootstrap a buildout-based project
16
17Simply run this script in a directory containing a buildout.cfg.
18The script accepts buildout command-line options, so you can
19use the -c option to specify an alternate configuration file.
20
21$Id$
22"""
23
24import os, shutil, sys, tempfile, urllib2
25
26tmpeggs = tempfile.mkdtemp()
27
28is_jython = sys.platform.startswith('java')
29
30try:
31 import pkg_resources
32except ImportError:
33 ez = {}
34 exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
35 ).read() in ez
36 ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
37
38 import pkg_resources
39
40if sys.platform == 'win32':
41 def quote(c):
42 if ' ' in c:
43 return '"%s"' % c # work around spawn lamosity on windows
44 else:
45 return c
46else:
47 def quote (c):
48 return c
49
50cmd = 'from setuptools.command.easy_install import main; main()'
51ws = pkg_resources.working_set
52
53if is_jython:
54 import subprocess
55
56 assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
57 quote(tmpeggs), 'zc.buildout'],
58 env=dict(os.environ,
59 PYTHONPATH=
60 ws.find(pkg_resources.Requirement.parse('setuptools')).location
61 ),
62 ).wait() == 0
63
64else:
65 assert os.spawnle(
66 os.P_WAIT, sys.executable, quote (sys.executable),
67 '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
68 dict(os.environ,
69 PYTHONPATH=
70 ws.find(pkg_resources.Requirement.parse('setuptools')).location
71 ),
72 ) == 0
73
74ws.add_entry(tmpeggs)
75ws.require('zc.buildout')
76import zc.buildout.buildout
77zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
78shutil.rmtree(tmpeggs)
790
=== removed symlink 'bootstrap.py'
=== target was u'_bootstrap/bootstrap.py'
=== removed file 'buildout.cfg'
--- buildout.cfg 2011-04-03 23:07:50 +0000
+++ buildout.cfg 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
1[buildout]
2parts =
3 interpreter
4 test
5 docs
6 tags
7unzip = true
8
9develop = .
10
11newest = false
12
13[test]
14recipe = zc.recipe.testrunner
15eggs = lazr.batchnavigator
16defaults = '--tests-pattern ^tests --exit-with-status --suite-name additional_tests'.split()
17
18[docs]
19recipe = z3c.recipe.sphinxdoc
20eggs = lazr.batchnavigator [docs]
21index-doc = README
22default.css =
23layout.html =
24
25[interpreter]
26recipe = zc.recipe.egg
27interpreter=py
28eggs = lazr.batchnavigator
29 docutils
30
31[tags]
32recipe = z3c.recipe.tag:tags
33eggs = lazr.batchnavigator
340
=== modified file 'setup.py'
--- setup.py 2015-07-08 11:04:14 +0000
+++ setup.py 2018-05-08 10:25:49 +0000
@@ -22,7 +22,7 @@
22def generate(*docname_or_string):22def generate(*docname_or_string):
23 res = []23 res = []
24 for value in docname_or_string:24 for value in docname_or_string:
25 if value.endswith('.txt'):25 if value.endswith('.rst'):
26 f = open(value)26 f = open(value)
27 value = f.read()27 value = f.read()
28 f.close()28 f.close()
@@ -34,40 +34,44 @@
3434
35__version__ = open("src/lazr/batchnavigator/version.txt").read().strip()35__version__ = open("src/lazr/batchnavigator/version.txt").read().strip()
3636
37tests_require = [
38 'testtools',
39 'zope.publisher',
40 'zope.testrunner',
41 ]
42
37setup(43setup(
38 name='lazr.batchnavigator',44 name='lazr.batchnavigator',
39 version=__version__,45 version=__version__,
40 namespace_packages=['lazr'],46 namespace_packages=['lazr'],
41 packages=find_packages('src'),47 packages=find_packages('src'),
42 package_dir={'':'src'},48 package_dir={'': 'src'},
43 include_package_data=True,49 include_package_data=True,
44 zip_safe=False,50 zip_safe=False,
45 maintainer='LAZR Developers',51 maintainer='LAZR Developers',
46 maintainer_email='lazr-users@lists.launchpad.net',52 maintainer_email='lazr-users@lists.launchpad.net',
47 description=open('README.txt').readline().strip(),53 description=open('README.rst').readline().strip(),
48 long_description=generate(54 long_description=generate(
49 'src/lazr/batchnavigator/README.txt',55 'src/lazr/batchnavigator/docs/index.rst',
50 'src/lazr/batchnavigator/NEWS.txt'),56 'src/lazr/batchnavigator/docs/NEWS.rst'),
51 license='LGPL v3',57 license='LGPL v3',
52 install_requires=[58 install_requires=[
53 'fixtures',
54 'setuptools',59 'setuptools',
55 'testtools',
56 'zope.cachedescriptors',60 'zope.cachedescriptors',
57 'zope.interface',61 'zope.interface',
58 'zope.publisher',
59 ],62 ],
60 url='https://launchpad.net/lazr.batchnavigator',63 url='https://launchpad.net/lazr.batchnavigator',
61 download_url= 'https://launchpad.net/lazr.batchnavigator/+download',64 download_url='https://launchpad.net/lazr.batchnavigator/+download',
62 classifiers=[65 classifiers=[
63 "Development Status :: 5 - Production/Stable",66 "Development Status :: 5 - Production/Stable",
64 "Intended Audience :: Developers",67 "Intended Audience :: Developers",
65 "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",68 "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
66 "Operating System :: OS Independent",69 "Operating System :: OS Independent",
67 "Programming Language :: Python"],70 "Programming Language :: Python"],
71 tests_require=tests_require,
68 extras_require=dict(72 extras_require=dict(
69 docs=['Sphinx',73 docs=['Sphinx'],
70 'z3c.recipe.sphinxdoc']74 test=tests_require,
71 ),75 ),
72 test_suite='lazr.batchnavigator.tests',76 test_suite='lazr.batchnavigator.tests',
73 )77 )
7478
=== added directory 'src/lazr/batchnavigator/docs'
=== added file 'src/lazr/batchnavigator/docs/Makefile'
--- src/lazr/batchnavigator/docs/Makefile 1970-01-01 00:00:00 +0000
+++ src/lazr/batchnavigator/docs/Makefile 2018-05-08 10:25:49 +0000
@@ -0,0 +1,20 @@
1# Minimal makefile for Sphinx documentation
2#
3
4# You can set these variables from the command line.
5SPHINXOPTS =
6SPHINXBUILD = sphinx-build
7SPHINXPROJ = lazrbatchnavigator
8SOURCEDIR = .
9BUILDDIR = _build
10
11# Put it first so that "make" without argument is like "make help".
12help:
13 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
15.PHONY: help Makefile
16
17# Catch-all target: route all unknown targets to Sphinx using the new
18# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19%: Makefile
20 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
0\ No newline at end of file21\ No newline at end of file
122
=== renamed file 'src/lazr/batchnavigator/NEWS.txt' => 'src/lazr/batchnavigator/docs/NEWS.rst'
--- src/lazr/batchnavigator/NEWS.txt 2015-04-09 13:48:10 +0000
+++ src/lazr/batchnavigator/docs/NEWS.rst 2018-05-08 10:25:49 +0000
@@ -2,6 +2,11 @@
2NEWS for lazr.batchnavigator2NEWS for lazr.batchnavigator
3============================3============================
44
51.2.12
6======
7
8- Switch from buildout to tox.
9
51.2.11 (2015-04-09)101.2.11 (2015-04-09)
6===================11===================
712
813
=== added file 'src/lazr/batchnavigator/docs/conf.py'
--- src/lazr/batchnavigator/docs/conf.py 1970-01-01 00:00:00 +0000
+++ src/lazr/batchnavigator/docs/conf.py 2018-05-08 10:25:49 +0000
@@ -0,0 +1,171 @@
1# -*- coding: utf-8 -*-
2#
3# lazr.batchnavigator documentation build configuration file, created by
4# sphinx-quickstart on Tue May 8 08:57:03 2018.
5#
6# This file is execfile()d with the current directory set to its
7# containing dir.
8#
9# Note that not all possible configuration values are present in this
10# autogenerated file.
11#
12# All configuration values have a default; values that are commented out
13# serve to show the default.
14
15with open('../version.txt') as version_file:
16 _version = version_file.read().strip()
17
18# If extensions (or modules to document with autodoc) are in another directory,
19# add these directories to sys.path here. If the directory is relative to the
20# documentation root, use os.path.abspath to make it absolute, like shown here.
21#
22# import os
23# import sys
24# sys.path.insert(0, os.path.abspath('.'))
25
26
27# -- General configuration ------------------------------------------------
28
29# If your documentation needs a minimal Sphinx version, state it here.
30#
31# needs_sphinx = '1.0'
32
33# Add any Sphinx extension module names here, as strings. They can be
34# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35# ones.
36extensions = []
37
38# Add any paths that contain templates here, relative to this directory.
39templates_path = ['_templates']
40
41# The suffix(es) of source filenames.
42# You can specify multiple suffix as a list of string:
43#
44# source_suffix = ['.rst', '.md']
45source_suffix = '.rst'
46
47# The master toctree document.
48master_doc = 'index'
49
50# General information about the project.
51project = u'lazr.batchnavigator'
52copyright = u'2004-2018, Canonical Ltd.'
53author = u'LAZR Developers <lazr-developers@lists.launchpad.net>'
54
55# The version info for the project you're documenting, acts as replacement for
56# |version| and |release|, also used in various other places throughout the
57# built documents.
58#
59# The short X.Y version.
60version = _version
61# The full version, including alpha/beta/rc tags.
62release = _version
63
64# The language for content autogenerated by Sphinx. Refer to documentation
65# for a list of supported languages.
66#
67# This is also used if you do content translation via gettext catalogs.
68# Usually you set "language" from the command line for these cases.
69language = None
70
71# List of patterns, relative to source directory, that match files and
72# directories to ignore when looking for source files.
73# This patterns also effect to html_static_path and html_extra_path
74exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
75
76# The name of the Pygments (syntax highlighting) style to use.
77pygments_style = 'sphinx'
78
79# If true, `todo` and `todoList` produce output, else they produce nothing.
80todo_include_todos = False
81
82
83# -- Options for HTML output ----------------------------------------------
84
85# The theme to use for HTML and HTML Help pages. See the documentation for
86# a list of builtin themes.
87#
88html_theme = 'alabaster'
89
90# Theme options are theme-specific and customize the look and feel of a theme
91# further. For a list of options available for each theme, see the
92# documentation.
93#
94# html_theme_options = {}
95
96# Add any paths that contain custom static files (such as style sheets) here,
97# relative to this directory. They are copied after the builtin static files,
98# so a file named "default.css" will overwrite the builtin "default.css".
99#html_static_path = ['_static']
100
101# Custom sidebar templates, must be a dictionary that maps document names
102# to template names.
103#
104# This is required for the alabaster theme
105# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
106html_sidebars = {
107 '**': [
108 'relations.html', # needs 'show_related': True theme option to display
109 'searchbox.html',
110 ]
111}
112
113
114# -- Options for HTMLHelp output ------------------------------------------
115
116# Output file base name for HTML help builder.
117htmlhelp_basename = 'lazrbatchnavigatordoc'
118
119
120# -- Options for LaTeX output ---------------------------------------------
121
122latex_elements = {
123 # The paper size ('letterpaper' or 'a4paper').
124 #
125 # 'papersize': 'letterpaper',
126
127 # The font size ('10pt', '11pt' or '12pt').
128 #
129 # 'pointsize': '10pt',
130
131 # Additional stuff for the LaTeX preamble.
132 #
133 # 'preamble': '',
134
135 # Latex figure (float) alignment
136 #
137 # 'figure_align': 'htbp',
138}
139
140# Grouping the document tree into LaTeX files. List of tuples
141# (source start file, target name, title,
142# author, documentclass [howto, manual, or own class]).
143latex_documents = [
144 (master_doc, 'lazrbatchnavigator.tex', u'lazr.batchnavigator Documentation',
145 u'LAZR Developers \\textless{}lazr-developers@lists.launchpad.net\\textgreater{}\'', 'manual'),
146]
147
148
149# -- Options for manual page output ---------------------------------------
150
151# One entry per manual page. List of tuples
152# (source start file, name, description, authors, manual section).
153man_pages = [
154 (master_doc, 'lazrbatchnavigator', u'lazr.batchnavigator Documentation',
155 [author], 1)
156]
157
158
159# -- Options for Texinfo output -------------------------------------------
160
161# Grouping the document tree into Texinfo files. List of tuples
162# (source start file, target name, title, author,
163# dir menu entry, description, category)
164texinfo_documents = [
165 (master_doc, 'lazrbatchnavigator', u'lazr.batchnavigator Documentation',
166 author, 'lazrbatchnavigator', 'One line description of project.',
167 'Miscellaneous'),
168]
169
170
171
0172
=== renamed file 'src/lazr/batchnavigator/README.txt' => 'src/lazr/batchnavigator/docs/index.rst'
--- src/lazr/batchnavigator/README.txt 2011-04-06 03:14:16 +0000
+++ src/lazr/batchnavigator/docs/index.rst 2018-05-08 10:25:49 +0000
@@ -24,17 +24,17 @@
24It uses four query/POST arguments to control the batching:24It uses four query/POST arguments to control the batching:
2525
26 - memo: A record of the underlying storage index pointer for the position of26 - memo: A record of the underlying storage index pointer for the position of
27 the batch.27 the batch.
28 - direction: Indicates whether the memo is at the start or end of the batch.28 - direction: Indicates whether the memo is at the start or end of the batch.
29 - start: Cosmetic - used to calculate the apparent location (but note that29 - start: Cosmetic - used to calculate the apparent location (but note that
30 due to the concurrent nature of repeated visits to batches that the30 due to the concurrent nature of repeated visits to batches that the
31 true offset may differ - however the collection won't skip or show31 true offset may differ - however the collection won't skip or show
32 items twice. For compatibility with saved URLs, if memo and32 items twice. For compatibility with saved URLs, if memo and
33 direction are both missing then start is used to do list slicing33 direction are both missing then start is used to do list slicing
34 into the collection.34 into the collection.
35 - batch: Controls the amount of items we are showing per batch. It will only35 - batch: Controls the amount of items we are showing per batch. It will only
36 appear if it's different from the default value set when the batch36 appear if it's different from the default value set when the batch
37 is created.37 is created.
3838
39These values can be overriden in the request, unless you also pass39These values can be overriden in the request, unless you also pass
40force_start=True, which will make the start argument (again, defaulting to 0)40force_start=True, which will make the start argument (again, defaulting to 0)
@@ -524,5 +524,4 @@
524.. toctree::524.. toctree::
525 :glob:525 :glob:
526526
527 *527 NEWS
528 docs/*
529528
=== modified file 'src/lazr/batchnavigator/tests/test_docs.py'
--- src/lazr/batchnavigator/tests/test_docs.py 2009-03-23 16:14:28 +0000
+++ src/lazr/batchnavigator/tests/test_docs.py 2018-05-08 10:25:49 +0000
@@ -17,14 +17,13 @@
1717
18__metaclass__ = type18__metaclass__ = type
19__all__ = [19__all__ = [
20 'additional_tests',20 'load_tests',
21 ]21 ]
2222
23import atexit23import atexit
24import doctest24import doctest
25import os25import os
26import pkg_resources26import pkg_resources
27import unittest
2827
29DOCTEST_FLAGS = (28DOCTEST_FLAGS = (
30 doctest.ELLIPSIS |29 doctest.ELLIPSIS |
@@ -32,19 +31,18 @@
32 doctest.REPORT_NDIFF)31 doctest.REPORT_NDIFF)
3332
3433
35def additional_tests():34def load_tests(loader, tests, pattern):
36 "Run the doc tests (README.txt and docs/*, if any exist)"35 """Load all the doctests."""
37 doctest_files = [36 atexit.register(pkg_resources.cleanup_resources)
38 os.path.abspath(37 doctest_files = []
39 pkg_resources.resource_filename('lazr.batchnavigator', 'README.txt'))]
40 if pkg_resources.resource_exists('lazr.batchnavigator', 'docs'):38 if pkg_resources.resource_exists('lazr.batchnavigator', 'docs'):
41 for name in pkg_resources.resource_listdir('lazr.batchnavigator', 'docs'):39 for name in pkg_resources.resource_listdir(
42 if name.endswith('.txt'):40 'lazr.batchnavigator', 'docs'):
41 if name.endswith('.rst'):
43 doctest_files.append(42 doctest_files.append(
44 os.path.abspath(43 os.path.abspath(
45 pkg_resources.resource_filename(44 pkg_resources.resource_filename(
46 'lazr.batchnavigator', 'docs/%s' % name)))45 'lazr.batchnavigator', 'docs/%s' % name)))
47 kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS)46 tests.addTest(doctest.DocFileSuite(
48 atexit.register(pkg_resources.cleanup_resources)47 *doctest_files, module_relative=False, optionflags=DOCTEST_FLAGS))
49 return unittest.TestSuite((48 return tests
50 doctest.DocFileSuite(*doctest_files, **kwargs)))
5149
=== added file 'tox.ini'
--- tox.ini 1970-01-01 00:00:00 +0000
+++ tox.ini 2018-05-08 10:25:49 +0000
@@ -0,0 +1,17 @@
1[tox]
2envlist =
3 py27,docs
4
5[testenv]
6commands =
7 zope-testrunner --test-path src --tests-pattern ^tests {posargs}
8deps =
9 .[test]
10
11[testenv:docs]
12basepython =
13 python2.7
14commands =
15 sphinx-build -b html -d src/lazr/batchnavigator/docs/_build/doctrees src/lazr/batchnavigator/docs src/lazr/batchnavigator/docs/_build/html
16deps =
17 .[docs]

Subscribers

People subscribed via source and target branches