@@ -56,46 +56,6 @@ def test_data_profiling(self):
56
56
self .assertIsNotNone (profile .profile )
57
57
self .assertIsNotNone (profile .report ())
58
58
59
- def test_no_snappy (self ):
60
- import importlib
61
- import sys
62
- import types
63
-
64
- orig_import = __import__
65
- # necessary for any wrapper around the library to test if snappy caught
66
- # as an issue
67
-
68
- def reload_data_profiler ():
69
- """Recursively reload modules."""
70
- sys_modules = sys .modules .copy ()
71
- for module_name , module in sys_modules .items ():
72
- # Only reload top level of the dataprofiler
73
- if "dataprofiler" in module_name and len (module_name .split ("." )) < 3 :
74
- if isinstance (module , types .ModuleType ):
75
- importlib .reload (module )
76
-
77
- def import_mock (name , * args , ** kwargs ):
78
- if name == "snappy" :
79
- raise ImportError ("test" )
80
- return orig_import (name , * args , ** kwargs )
81
-
82
- with mock .patch ("builtins.__import__" , side_effect = import_mock ):
83
- with self .assertWarns (ImportWarning ) as w :
84
- import dataprofiler
85
-
86
- reload_data_profiler ()
87
-
88
- self .assertEqual (
89
- str (w .warning ),
90
- "Snappy must be installed to use parquet/avro datasets."
91
- "\n \n "
92
- "For macOS use Homebrew:\n "
93
- "\t `brew install snappy`"
94
- "\n \n "
95
- "For linux use apt-get:\n `"
96
- "\t sudo apt-get -y install libsnappy-dev`\n " ,
97
- )
98
-
99
59
def test_no_tensorflow (self ):
100
60
import sys
101
61
0 commit comments