-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtests.html
More file actions
236 lines (223 loc) · 11.8 KB
/
tests.html
File metadata and controls
236 lines (223 loc) · 11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>Unit tests — SpacePy v0.7.0 Manual</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b76e3c8a" />
<link rel="stylesheet" type="text/css" href="_static/sphinxdoc.css?v=92e3d466" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=fd3f3429" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<script src="_static/documentation_options.js?v=fe7df9b0"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script type="text/javascript" src="_static/copybutton.js"></script>
<link rel="icon" href="_static/spacepy_favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="spacepy_testing.assertWarns" href="autosummary/spacepy_testing.assertWarns.html" />
<link rel="prev" title="Documentation Standard" href="doc_standard.html" />
</head><body>
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="index.html"><img src="_static/spacepy_logo.jpg" border="0" alt="spacepy_logo"/></a>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="autosummary/spacepy_testing.assertWarns.html" title="spacepy_testing.assertWarns"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="doc_standard.html" title="Documentation Standard"
accesskey="P">previous</a> |</li>
<li><a href="https://spacepy.github.io/"">homepage</a>| </li>
<li><a href="https://github.com/spacepy/spacepy">development</a>| </li>
<li><a href="search.html">search</a>| </li>
<li><a href="index.html">documentation </a> »</li>
<li class="nav-item nav-item-this"><a href="">Unit tests</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="unit-tests">
<h1>Unit tests<a class="headerlink" href="#unit-tests" title="Link to this heading">¶</a></h1>
<nav class="contents local" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#module-spacepy_testing" id="id2">The spacepy_testing module</a></p>
<ul>
<li><p><a class="reference internal" href="#classes" id="id3">Classes</a></p></li>
<li><p><a class="reference internal" href="#functions" id="id4">Functions</a></p></li>
<li><p><a class="reference internal" href="#data" id="id5">Data</a></p></li>
</ul>
</li>
</ul>
</nav>
<p>Unit tests are in the <code class="docutils literal notranslate"><span class="pre">tests</span></code> directory. Individual scripts can be
run from this directory, or <code class="docutils literal notranslate"><span class="pre">test_all.py</span></code> will run all tests in all
scripts.</p>
<p>spacepy must be installed before running the tests. To avoid affecting an
installed version while testing, use a separate <a class="reference external" href="https://docs.python.org/3/library/venv.html#module-venv" title="(in Python v3.13)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">venv</span></code></a> or conda
environment, or install in a custom location using
<a class="reference external" href="https://pip.pypa.io/en/stable/cli/pip_install/#install-prefix" title="(in pip v24.3)"><span class="xref std std-ref">--prefix</span></a> and manually edit
<span class="target" id="index-0"></span><a class="reference external" href="https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH" title="(in Python v3.13)"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPATH</span></code></a>.</p>
<p>Using an <a class="reference external" href="https://pip.pypa.io/en/stable/cli/pip_install/#install-editable" title="(in pip v24.3)"><span class="xref std std-ref">editable install</span></a> may be useful to save
time with repeated installs while editing.</p>
<section id="module-spacepy_testing">
<span id="the-spacepy-testing-module"></span><h2><a class="toc-backref" href="#id2" role="doc-backlink">The spacepy_testing module</a><a class="headerlink" href="#module-spacepy_testing" title="Link to this heading">¶</a></h2>
<p>The <code class="docutils literal notranslate"><span class="pre">spacepy_testing</span></code> module contains utilities for assistance with
testing SpacePy. It is not installed as part of SpacePy and is thus
only importable from the unit test scripts themselves (which are in the
same directory). All unit test scripts import this module.</p>
<nav class="contents local" id="id1">
<ul class="simple">
<li><p><a class="reference internal" href="#classes" id="id6">Classes</a></p></li>
<li><p><a class="reference internal" href="#functions" id="id7">Functions</a></p></li>
<li><p><a class="reference internal" href="#data" id="id8">Data</a></p></li>
</ul>
</nav>
<section id="classes">
<h3><a class="toc-backref" href="#id6" role="doc-backlink">Classes</a><a class="headerlink" href="#classes" title="Link to this heading">¶</a></h3>
<div class="line-block">
<div class="line"><br /></div>
</div>
<table class="autosummary longtable docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="autosummary/spacepy_testing.assertWarns.html#spacepy_testing.assertWarns" title="spacepy_testing.assertWarns"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assertWarns</span></code></a>(test[, action, message, ...])</p></td>
<td><p>Tests that a warning is raised.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="autosummary/spacepy_testing.assertDoesntWarn.html#spacepy_testing.assertDoesntWarn" title="spacepy_testing.assertDoesntWarn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assertDoesntWarn</span></code></a>(test[, action, message, ...])</p></td>
<td><p>Tests that a warning is not raised.</p></td>
</tr>
</tbody>
</table>
</section>
<section id="functions">
<h3><a class="toc-backref" href="#id7" role="doc-backlink">Functions</a><a class="headerlink" href="#functions" title="Link to this heading">¶</a></h3>
<div class="line-block">
<div class="line"><br /></div>
</div>
<table class="autosummary longtable docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="autosummary/spacepy_testing.add_build_to_path.html#spacepy_testing.add_build_to_path" title="spacepy_testing.add_build_to_path"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_build_to_path</span></code></a>()</p></td>
<td><p>Adds the python build directory to the search path.</p></td>
</tr>
</tbody>
</table>
</section>
<section id="data">
<h3><a class="toc-backref" href="#id8" role="doc-backlink">Data</a><a class="headerlink" href="#data" title="Link to this heading">¶</a></h3>
<div class="line-block">
<div class="line"><br /></div>
</div>
<table class="autosummary longtable docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="autosummary/spacepy_testing.datadir.html#spacepy_testing.datadir" title="spacepy_testing.datadir"><code class="xref py py-obj docutils literal notranslate"><span class="pre">datadir</span></code></a></p></td>
<td><p>Directory containing unit test data</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="autosummary/spacepy_testing.testsdir.html#spacepy_testing.testsdir" title="spacepy_testing.testsdir"><code class="xref py py-obj docutils literal notranslate"><span class="pre">testsdir</span></code></a></p></td>
<td><p>Directory containing the unit test scripts</p></td>
</tr>
</tbody>
</table>
<hr class="docutils" />
<dl class="field-list simple">
<dt class="field-odd">Release<span class="colon">:</span></dt>
<dd class="field-odd"><p>0.7.0</p>
</dd>
<dt class="field-even">Doc generation date<span class="colon">:</span></dt>
<dd class="field-even"><p>Nov 08, 2024</p>
</dd>
</dl>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/logo.png" alt="Logo"/>
</a></p>
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Unit tests</a><ul>
<li><a class="reference internal" href="#module-spacepy_testing">The spacepy_testing module</a><ul>
<li><a class="reference internal" href="#classes">Classes</a></li>
<li><a class="reference internal" href="#functions">Functions</a></li>
<li><a class="reference internal" href="#data">Data</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="doc_standard.html"
title="previous chapter">Documentation Standard</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="autosummary/spacepy_testing.assertWarns.html"
title="next chapter">spacepy_testing.assertWarns</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/tests.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="autosummary/spacepy_testing.assertWarns.html" title="spacepy_testing.assertWarns"
>next</a> |</li>
<li class="right" >
<a href="doc_standard.html" title="Documentation Standard"
>previous</a> |</li>
<li><a href="https://spacepy.github.io/"">homepage</a>| </li>
<li><a href="https://github.com/spacepy/spacepy">development</a>| </li>
<li><a href="search.html">search</a>| </li>
<li><a href="index.html">documentation </a> »</li>
<li class="nav-item nav-item-this"><a href="">Unit tests</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011-2024, The SpacePy Team.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.3.7.
</div>
</body>
</html>