Skip to content

Commit 23f9e9b

Browse files
committed
fixture tutorial, first iteration
1 parent 4d2a9c3 commit 23f9e9b

5 files changed

Lines changed: 170 additions & 294 deletions

File tree

climada/test/common_test_fixtures.py

Lines changed: 0 additions & 205 deletions
This file was deleted.

climada/test/fixture_use_example.py

Lines changed: 0 additions & 83 deletions
This file was deleted.

doc/development/Guide_Testing.ipynb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"Writing tests is work. As a matter of facts, it can be a _lot_ of work, depending on the program often more than writing the original code.\\\n",
2121
"Luckily, it essentially follows always the same basic procedure and a there are a lot of tools and frameworks available to facilitate this work.\n",
2222
"\n",
23-
"In CLIMADA we use the Python in-built _test runner_ [pytest](https://docs.pytest.org/en/7.1.x/index.html) for execution of the tests."
23+
"In CLIMADA we use the Python in-built _test runner_ [pytest](https://docs.pytest.org/en/7.1.x/index.html) for execution of the tests.\n",
24+
"\n",
25+
"We now leverage `pytest` fixtures for defining the data and context used by tests. Please read [how to use fixtures for testing in CLIMADA](Guide_test_fixtures.ipynb)."
2426
]
2527
},
2628
{
@@ -53,7 +55,6 @@
5355
},
5456
{
5557
"cell_type": "markdown",
56-
"id": "5819e8c6",
5758
"metadata": {},
5859
"source": [
5960
"### Basic Test Procedure\n",
@@ -277,7 +278,9 @@
277278
"source": [
278279
"### Test Configuration\n",
279280
"\n",
280-
"Use the configuration file `climada.config` in the installation directory to define file paths and external resources used during tests (see the [Constants and Configuration Guide](./Guide_Configuration.ipynb))."
281+
"Integration tests should make use of the fixtures defined in `climada/test/conftest.py`. Learn how to do that in [how to use fixtures for testing in CLIMADA](Guide_test_fixtures.ipynb).\n",
282+
"\n",
283+
"Test data can also use paths defined in the configuration file `climada.config` (in the installation directory) which define file paths and external resources to be used during tests (see the [Constants and Configuration Guide](./Guide_Configuration.ipynb))."
281284
]
282285
},
283286
{
@@ -334,9 +337,9 @@
334337
],
335338
"metadata": {
336339
"kernelspec": {
337-
"display_name": "Python 3 (ipykernel)",
340+
"display_name": "Python [conda env:climada_env_dev]",
338341
"language": "python",
339-
"name": "python3"
342+
"name": "conda-env-climada_env_dev-py"
340343
},
341344
"language_info": {
342345
"codemirror_mode": {
@@ -348,7 +351,7 @@
348351
"name": "python",
349352
"nbconvert_exporter": "python",
350353
"pygments_lexer": "ipython3",
351-
"version": "3.12.6"
354+
"version": "3.11.15"
352355
},
353356
"vscode": {
354357
"interpreter": {

0 commit comments

Comments
 (0)