File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -294,3 +294,40 @@ def skip_if_no_package(*args, **kwargs):
294
294
package_check (exc_failed_import = SkipTest ,
295
295
exc_failed_check = SkipTest ,
296
296
* args , ** kwargs )
297
+
298
+ #
299
+ # Additional tags decorators for nose
300
+ #
301
+ def network (t ):
302
+ """
303
+ Label a test as requiring network connection.
304
+
305
+ In some cases it is not possible to assume network presence (e.g. Debian
306
+ build hosts).
307
+
308
+ Parameters
309
+ ----------
310
+ t : callable
311
+ The test requiring network connectivity.
312
+
313
+ Returns
314
+ -------
315
+ t : callable
316
+ The decorated test `t`.
317
+
318
+ Examples
319
+ --------
320
+ A test can be decorated as requiring network like this::
321
+
322
+ from pandas.util.testing import *
323
+
324
+ @network
325
+ def test_network(self):
326
+ print 'Fetch the stars from http://'
327
+
328
+ And use ``nosetests -a '!network'`` to exclude running tests requiring
329
+ network connectivity.
330
+ """
331
+
332
+ t .network = True
333
+ return t
You can’t perform that action at this time.
0 commit comments