This repository was archived by the owner on Aug 25, 2024. It is now read-only.
File tree 4 files changed +17
-6
lines changed 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ test_no_skips() {
38
38
TEMP_DIRS+=(" ${check_skips} " )
39
39
40
40
# Run with coverage
41
- RUN_CONSOLETESTS =1 " ${PYTHON} " -u -m coverage run -m unittest discover -v 2>&1 | tee " ${check_skips} "
41
+ TEST_DOCS =1 " ${PYTHON} " -u -m coverage run -m unittest discover -v 2>&1 | tee " ${check_skips} "
42
42
" ${PYTHON} " -m coverage report -m
43
43
44
44
# Fail if any coroutines were not awaited
@@ -136,7 +136,7 @@ function run_consoletest() {
136
136
# Install base package with testing and development utilities
137
137
" ${PYTHON} " -m pip install -U -e " .[dev]"
138
138
139
- RUN_CONSOLETESTS =1 " ${PYTHON} " -u -m unittest " tests.docs.test_consoletest.TestDocs.test_${PLUGIN} " 2>&1 | tee " ${test_log} "
139
+ TEST_DOCS =1 " ${PYTHON} " -u -m unittest " tests.docs.test_consoletest.TestDocs.test_${PLUGIN} " 2>&1 | tee " ${test_log} "
140
140
141
141
# Fail if any coroutines were not awaited
142
142
unawaited=$( grep -nE ' coroutine .* was never awaited' " ${test_log} " | wc -l)
Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ You can also run all tests which have a given string in their name.
23
23
24
24
$ python3 -m unittest discover -v -k unpack_
25
25
26
+ You can run all documentation related testcases with the following command
27
+
28
+ .. code-block :: console
29
+
30
+ $ TEST_DOCS=1 python3 -m unittest discover -v tests/docs/
31
+
26
32
Writing Tests
27
33
-------------
28
34
Original file line number Diff line number Diff line change @@ -173,10 +173,10 @@ def pickle_load(fileobj):
173
173
if str (relative ) not in NO_SETUP :
174
174
# Don't check for a long test entry in the workflow if doc in NO_SETUP
175
175
TestDocs .TESTABLE_DOCS .append (str (relative ))
176
- # Skip if not in NO_SETUP and RUN_CONSOLETESTS not set
176
+ # Skip if not in NO_SETUP and TEST_DOCS not set
177
177
testcase = unittest .skipIf (
178
- "RUN_CONSOLETESTS " not in os .environ ,
179
- "RUN_CONSOLETESTS environment variable not set" ,
178
+ "TEST_DOCS " not in os .environ ,
179
+ "TEST_DOCS environment variable not set" ,
180
180
)(testcase )
181
181
# Do not add the tests if we are running with GitHub Actions for the main
182
182
# package. This is because there are separate jobs for each tutorial test
Original file line number Diff line number Diff line change 9
9
from dffml .util .asynctestcase import AsyncTestCase
10
10
from dffml .util .os import chdir
11
11
12
- TESTS_PATH = pathlib .Path (__file__ ).parent
12
+ TESTS_PATH = pathlib .Path (__file__ ).parents [ 1 ]
13
13
NOTEBOOK_DATA_PATH = TESTS_PATH .joinpath ("notebooks" , "data" )
14
14
NB_PATH = TESTS_PATH .parent / "examples" / "notebooks"
15
15
@@ -32,6 +32,11 @@ def testcase(self):
32
32
with testbook (path , timeout = - 1 , execute = True ) as tb :
33
33
pass
34
34
35
+ testcase = unittest .skipIf (
36
+ "TEST_DOCS" not in os .environ ,
37
+ "TEST_DOCS environment variable not set" ,
38
+ )(testcase )
39
+
35
40
return testcase
36
41
37
42
You can’t perform that action at this time.
0 commit comments