We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1429294 + 6692372 commit 18462e5Copy full SHA for 18462e5
plantcv/plantcv/warn.py
@@ -1,14 +1,21 @@
1
# Warnings handling
2
3
import sys
4
+from plantcv.plantcv import params
5
6
7
def warn(warning):
- """Print out warning message
8
+ """Print a warning message to stderr.
9
- Inputs:
10
- warning = warning message text
+ Parameters
11
+ ----------
12
+ warning : str
13
+ Warning message to print.
14
- :param warning: str
15
+ Returns
16
+ -------
17
+ None
18
+ Function does not return anything.
19
"""
- print(f"Warning: {warning}", file=sys.stderr)
20
+ if params.verbose:
21
+ print(f"Warning: {warning}", file=sys.stderr)
tests/plantcv/test_warn.py
@@ -0,0 +1,7 @@
+from plantcv.plantcv import warn
+
+def test_warn():
+ """Test for PlantCV."""
+ warn("This is a warning message.")
+ assert True
0 commit comments