@@ -18,9 +18,26 @@ function set_status() {
18
18
STATUS=$(( $last_status || $STATUS ))
19
19
}
20
20
21
+ PY_BIN=$( python -c " import sys; print('python%s' % sys.version[0:3])" )
22
+
23
+
24
+ # Certain datasets/tests don't work with Python 2
25
+ PY2_IGNORE_TESTS=" "
26
+ if [[ " $PY_BIN " = " python2.7" ]]
27
+ then
28
+ PY2_IGNORE_TESTS="
29
+ tensorflow_datasets/audio/nsynth_test.py
30
+ tensorflow_datasets/text/c4_test.py
31
+ tensorflow_datasets/text/c4_utils_test.py
32
+ tensorflow_datasets/image/imagenet2012_corrupted_test.py
33
+ "
34
+ fi
35
+ PY2_IGNORE=$( for test in $PY2_IGNORE_TESTS ; do echo " --ignore=$test " ; done)
36
+
37
+
21
38
# Run Tests
22
39
# Ignores:
23
- # * Some TF2 tests if running against TF2 (see above)
40
+ # * Some Python2 tests if running against Python2 (see above)
24
41
# * Nsynth is run is isolation due to dependency conflict (crepe)
25
42
# * Lsun tests is disabled because the tensorflow_io used in open-source
26
43
# is linked to static libraries compiled again specific TF version, which
@@ -33,6 +50,7 @@ function set_status() {
33
50
pytest \
34
51
-n auto \
35
52
--disable-warnings \
53
+ $PY2_IGNORE \
36
54
--ignore=" tensorflow_datasets/audio/nsynth_test.py" \
37
55
--ignore=" tensorflow_datasets/image/lsun_test.py" \
38
56
--ignore=" tensorflow_datasets/testing/test_utils.py" \
@@ -53,7 +71,6 @@ NOTEBOOKS="
53
71
docs/overview.ipynb
54
72
docs/_index.ipynb
55
73
"
56
- PY_BIN=$( python -c " import sys; print('python%s' % sys.version[0:3])" )
57
74
function test_notebook() {
58
75
local notebook=$1
59
76
create_virtualenv tfds_notebook $PY_BIN
0 commit comments