Skip to content

Commit 9076fce

Browse files
author
Antoine DECHAUME
committed
Merge branch 'develop'
2 parents 03ccbc7 + d84dc1d commit 9076fce

39 files changed

+384
-212
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.ci
22
.eggs
33
*.egg-info
4+
.tox

CHANGELOG.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,21 @@ All notable changes to this project will be documented here.
88
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
99
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
1010

11-
0.3.0 - Unreleased
11+
0.4.0 - 2020-05-03
12+
------------------
13+
14+
Removed
15+
~~~~~~~
16+
- equal_nan option is too specific and can easily be added with a custom fixture.
17+
18+
0.3.1 - 2020-03-30
19+
------------------
20+
21+
Added
22+
~~~~~
23+
- Report generation can handle a sphinx _static directory.
24+
25+
0.3.0 - 2020-03-19
1226
------------------
1327

1428
Added
File renamed without changes.

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include versioneer.py
2+
include src/pytest_executable/*.yaml

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
1-
Pytest-executable
2-
=================
1+
# Pytest-executable
32

4-
A pytest plugin for testing executables.
5-
For more informations, please read the [documentation](https://pytest-executable.readthedocs.io/en/latest).
3+
`pytest-executable` is a [pytest](https://docs.pytest.org/en/latest/) plugin
4+
for checking and validating executables. This project is still young, but
5+
already used in a professional environment.
6+
7+
## Documentation
8+
9+
The project documentation is available
10+
[online](https://pytest-executable.readthedocs.io/en/latest) (or in the
11+
[`doc`](doc) directory of the repository if you are fluent in
12+
reStructuredText).
13+
14+
## Installation and Usage
15+
16+
A `pytest-executable` package will soon be available in the Conda-Forge and
17+
PyPi repositories (just a matter of free time). In the meantime, you can get
18+
`pytest-executable` by cloning the project repository on Github:
19+
20+
```bash
21+
git clone https://github.com/CS-SI/pytest-executable.git
22+
```
23+
24+
The components required for `pytest-executable` and how to install them are
25+
described in the
26+
[documentation](https://pytest-executable.readthedocs.io/en/latest/installation.html).
27+
28+
## Contributing
29+
30+
A contributing guide will be soon available (once again, just a matter of free
31+
time).
32+
33+
Please fill an issue on the
34+
[Github issue tracker](https://github.com/CS-SI/pytest-executable/issues) for
35+
any bug report, feature request or question.
36+
37+
## Authors
38+
39+
* **[Antoine Dechaume](https://github.com/AntoineD)** - *Project creator and maintainer*
40+
41+
## Copyright and License
42+
43+
Copyright 2020, [CS GROUP](http://www.csgroup.eu)
44+
45+
`pytest-executable` is a free and open source software, distributed under the
46+
Apache License 2.0. See the [`LICENSE.txt`](LICENSE.txt) file for more
47+
information, or the
48+
[quick summary](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)) of
49+
this license on [tl;drLegal](https://tldrlegal.com/) website.

doc/cli.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,20 @@ Plugin options
6565

6666
.. option:: --default-settings PATH
6767

68-
use the yaml file at PATH for the global default test settings instead of
68+
use PATH as the yaml file with the global default test settings instead of
6969
the built-in ones
7070

71-
.. option:: --equal-nan
72-
73-
consider nan values as equal when doing comparison with the references for
74-
the built-in regression testing
75-
7671
.. option:: --report-generator PATH
77-
use the script at PATH to generate a test report
72+
73+
use PATH as the script to generate the test report
7874

7975
See the :file:`report-conf` directory for an example of such a script.
8076

77+
.. note::
78+
79+
The report generator script may require to install additionnal
80+
dependencies, such as sphinx, which are not required by the plugin.
81+
8182

8283
.. _filter:
8384

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
'sphinx.ext.napoleon',
3333
'sphinx.ext.autodoc',
3434
'sphinx_autodoc_typehints',
35+
'sphinxcontrib.spelling',
3536
]
3637

3738
# Add any paths that contain templates here, relative to this directory.

doc/fixtures.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,3 @@ variable that holds a `Path`_ object.
7777

7878
You may use this fixture with the :py:data:`output_path` fixture to get the
7979
path to the file that shall be compared to a reference file.
80-
81-
82-
Equal Nan fixture
83-
-----------------
84-
85-
This fixture provides the boolean :py:data:`equal_nan`, its value is set from
86-
the |pytest| command line option :option:`--equal-nan`. See the option
87-
documentation for more informations.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
sphinx>=2
12
sphinx-autodoc-typehints
23
sphinx_rtd_theme
3-
versioneer
4+
sphinxcontrib.spelling

doc/test-case.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ settings for running the case and finally perform the checks and
4545
post-porcesses. If |yaml| is empty, then the default settings are used, which
4646
is equivalent to using a |yaml| with the following contents:
4747

48-
.. literalinclude:: ../pytest_executable/test_case.yaml
48+
.. literalinclude:: ../src/pytest_executable/test_case.yaml
4949

5050
This file is in yaml format, a widely used human friendly file format that
5151
allows to define nested sections, lists of items, key-value pairs and more. To

doc/test_case_yaml.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ Builtin test module
2222

2323
This is the python module executed when the testing tool finds a :file:`test_case.yaml`, this module can be used as an example for writing new test modules.
2424

25-
.. literalinclude:: ../pytest_executable/test_case_yaml.py
25+
.. literalinclude:: ../src/pytest_executable/test_case_yaml.py

doc/usage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ For instance, if the test inputs tree contains::
4343
├── dir-1
4444
│ ├── case.input
4545
│ └── test_case.yaml
46-
└── dir-1
46+
└── dir-2
4747
├── case.input
4848
└── test_case.yaml
4949

@@ -52,15 +52,15 @@ Then the output tree is::
5252
tests-output
5353
├── dir-1
5454
│ ├── case.input -> path/to/tests/inputs/dir-1/case.input
55-
│ ├── case.ouput
55+
│ ├── case.output
5656
│ ├── executable.stderr
5757
│ ├── executable.stdout
5858
│ ├── run_executable.sh
5959
│ ├── run_executable.stderr
6060
│ └── run_executable.stdout
6161
├── dir-2
6262
├── case.input -> path/to/tests/inputs/dir-2/case.input
63-
├── case.ouput
63+
├── case.output
6464
├── executable.stderr
6565
├── executable.stdout
6666
├── run_executable.sh

pytest.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
[pytest]
2-
addopts = --ignore tests/data
2+
testpaths = tests
3+
addopts =
4+
--ignore tests/data
35
filterwarnings =
46
ignore::pytest.PytestExperimentalApiWarning

report-conf/conf.py

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@
1616
# import sys
1717
# sys.path.insert(0, os.path.abspath('.'))
1818
def setup(app):
19-
app.add_css_file("html_width.css")
19+
app.add_css_file("html_width.css")
20+
2021

2122
# -- Project information -----------------------------------------------------
2223

23-
project = 'Validation Case'
24-
copyright = ''
25-
author = ''
24+
project = "Validation Case"
25+
copyright = ""
26+
author = ""
2627

2728
# The short X.Y version
28-
version = ''
29+
version = ""
2930
# The full version, including alpha/beta/rc tags
30-
release = 'V1.0'
31+
release = "V1.0"
3132

3233

3334
# -- General configuration ---------------------------------------------------
@@ -40,25 +41,25 @@ def setup(app):
4041
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4142
# ones.
4243
extensions = [
43-
'sphinx.ext.autodoc',
44-
'sphinx.ext.mathjax',
44+
"sphinx.ext.autodoc",
45+
"sphinx.ext.mathjax",
4546
]
4647
mathjax_path = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_CHTML-full"
4748

48-
#extensions = ['sphinxcontrib.katex']
49+
# extensions = ['sphinxcontrib.katex']
4950

5051

5152
# Add any paths that contain templates here, relative to this directory.
52-
templates_path = ['_templates']
53+
templates_path = ["_templates"]
5354

5455
# The suffix(es) of source filenames.
5556
# You can specify multiple suffix as a list of string:
5657
#
5758
# source_suffix = ['.rst', '.md']
58-
source_suffix = '.rst'
59+
source_suffix = ".rst"
5960

6061
# The master toctree document.
61-
master_doc = 'index'
62+
master_doc = "index"
6263

6364
# The language for content autogenerated by Sphinx. Refer to documentation
6465
# for a list of supported languages.
@@ -82,21 +83,23 @@ def setup(app):
8283
# a list of builtin themes.
8384
#
8485

85-
html_theme = 'sphinx_rtd_theme'
86-
html_theme_path = ["_themes", ]
86+
html_theme = "sphinx_rtd_theme"
87+
html_theme_path = [
88+
"_themes",
89+
]
8790
html_theme_options = {
88-
'canonical_url': '',
89-
'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard
90-
'display_version': True,
91-
'prev_next_buttons_location': 'bottom',
92-
'style_external_links': False,
93-
'style_nav_header_background': 'white',
91+
"canonical_url": "",
92+
"analytics_id": "UA-XXXXXXX-1", # Provided by Google in your dashboard
93+
"display_version": True,
94+
"prev_next_buttons_location": "bottom",
95+
"style_external_links": False,
96+
"style_nav_header_background": "white",
9497
# Toc options
95-
'collapse_navigation': True,
96-
'sticky_navigation': True,
97-
'navigation_depth': 4,
98-
'includehidden': True,
99-
'titles_only': False
98+
"collapse_navigation": True,
99+
"sticky_navigation": True,
100+
"navigation_depth": 4,
101+
"includehidden": True,
102+
"titles_only": False,
100103
}
101104

102105
# Theme options are theme-specific and customize the look and feel of a theme
@@ -106,7 +109,7 @@ def setup(app):
106109
# Add any paths that contain custom static files (such as style sheets) here,
107110
# relative to this directory. They are copied after the builtin static files,
108111
# so a file named "default.css" will overwrite the builtin "default.css".
109-
#html_static_path = ['_static']
112+
html_static_path = ["_static"]
110113

111114
# Custom sidebar templates, must be a dictionary that maps document names
112115
# to template names.
@@ -123,7 +126,7 @@ def setup(app):
123126
# -- Options for HTMLHelp output ---------------------------------------------
124127

125128
# Output file base name for HTML help builder.
126-
htmlhelp_basename = 'Validation Case'
129+
htmlhelp_basename = "Validation Case"
127130

128131

129132
# -- Options for LaTeX output ------------------------------------------------
@@ -132,15 +135,12 @@ def setup(app):
132135
# The paper size ('letterpaper' or 'a4paper').
133136
#
134137
# 'papersize': 'letterpaper',
135-
136138
# The font size ('10pt', '11pt' or '12pt').
137139
#
138140
# 'pointsize': '10pt',
139-
140141
# Additional stuff for the LaTeX preamble.
141142
#
142143
# 'preamble': '',
143-
144144
# Latex figure (float) alignment
145145
#
146146
# 'figure_align': 'htbp',
@@ -150,19 +150,15 @@ def setup(app):
150150
# (source start file, target name, title,
151151
# author, documentclass [howto, manual, or own class]).
152152
latex_documents = [
153-
(master_doc, 'Validation_case.tex', 'Validation case',
154-
' ', 'manual'),
153+
(master_doc, "Validation_case.tex", "Validation case", " ", "manual"),
155154
]
156155

157156

158157
# -- Options for manual page output ------------------------------------------
159158

160159
# One entry per manual page. List of tuples
161160
# (source start file, name, description, authors, manual section).
162-
man_pages = [
163-
(master_doc, 'validation_case', 'Validation case',
164-
[author], 1)
165-
]
161+
man_pages = [(master_doc, "validation_case", "Validation case", [author], 1)]
166162

167163

168164
# -- Options for Texinfo output ----------------------------------------------
@@ -171,9 +167,15 @@ def setup(app):
171167
# (source start file, target name, title, author,
172168
# dir menu entry, description, category)
173169
texinfo_documents = [
174-
(master_doc, 'Validation_case', 'Validation case',
175-
author, 'Validation_case', 'One line description of project.',
176-
'Miscellaneous'),
170+
(
171+
master_doc,
172+
"Validation_case",
173+
"Validation case",
174+
author,
175+
"Validation_case",
176+
"One line description of project.",
177+
"Miscellaneous",
178+
),
177179
]
178180

179181

@@ -192,7 +194,7 @@ def setup(app):
192194
# epub_uid = ''
193195

194196
# A list of files that should not be packed into the epub file.
195-
epub_exclude_files = ['search.html']
197+
epub_exclude_files = ["search.html"]
196198

197199

198200
# -- Extension configuration -------------------------------------------------

report-conf/generate_report.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
with the command: conda install tabluate sphinx
3838
"""
3939

40+
import shutil
4041
import subprocess
4142
import textwrap
4243
from pathlib import Path
4344
from typing import List, Tuple
4445

4546
import yaml
46-
4747
from tabulate import tabulate
4848

4949
# indentation used in the toc tree of the index template
@@ -130,6 +130,10 @@ def create_index_rst(output_root: Path) -> None:
130130

131131
# create the report index.rst
132132
create_index_rst(output_root)
133+
# copy the _static directory if it exists
134+
static_path = DOC_GENERATOR_DIRPATH / "_static"
135+
if static_path.exists():
136+
shutil.copytree(static_path, output_root / "_static")
133137

134138
# command line to build the report
135139
cmd = (

0 commit comments

Comments
 (0)