Repository: sunpy/sunpy

Issue:
parfive fails to download if some clients return no results
Take the following example:

```python
import asyncio

import astropy.units as u
from sunpy.net import Fido
from sunpy.net import attrs as a

import parfive

stereo = (a.Detector('STEREO_B') &
          a.Instrument('EUVI') &
          a.Time('2011-01-01', '2011-01-01T00:10:00'))

aia = (a.Instrument('AIA') &
       a.Sample(24 * u.hour) &
       a.Time('2011-01-01', '2011-01-02'))

wave = a.Wavelength(30 * u.nm, 31 * u.nm)

results = Fido.search(stereo | aia, wave)
print(results)

downloader = parfive.Downloader(loop=asyncio.get_event_loop())
res = Fido.fetch(results, path='./{file}', downloader=downloader)
```

At the time of writing the STEREO part of the query was not returning any results. The output of the script was:
```
Results from 2 Providers:

0 Results from the VSOClient:
Start Time End Time  Source Instrument   Type 
 float64   float64  float64  float64   float64
---------- -------- ------- ---------- -------

1 Results from the VSOClient:
   Start Time [1]       End Time [1]    Source Instrument   Type   Wavelength [2]
                                                                      Angstrom   
       str19               str19         str3     str3      str8      float64    
------------------- ------------------- ------ ---------- -------- --------------
2011-01-01 00:00:08 2011-01-01 00:00:09    SDO        AIA FULLDISK 304.0 .. 304.0


Files Downloaded: 0file [00:00, ?file/s]
Files Downloaded:   0%|                                                                                                                                                                                    | 0/1 [00:00<?, ?file/s]Traceback (most recent call last):
  File "download_coord_data.py", line 20, in <module>
    res = Fido.fetch(results, path='./{file}', downloader=downloader)
  File "/home/stuart/.virtualenvs/sunpy-release/lib/python3.7/site-packages/sunpy/net/fido_factory.py", line 378, in fetch
    results = downloader.download()
  File "/home/stuart/Git/parfive/parfive/downloader.py", line 194, in download
    future = self.run_until_complete(self._run_download(timeouts))
  File "/usr/lib/python3.7/asyncio/base_events.py", line 577, in run_until_complete
    raise RuntimeError('Event loop stopped before Future completed.')
RuntimeError: Event loop stopped before Future completed.
```

The part where it get's really weird is if you swap the order of `aia` and `stereo` around so the fetch line looks like this:
```python
results = Fido.search(aia | stereo, wave)
```
it works without error and happily only downloads the aia image.


Discussion:
So the reason the STEREO download fails is that it shoudn't be `a.Detector` it should be `a.vso.Source`, which at least means the error above should be reproduceable.

Resolving patch:
diff --git a/sunpy/net/vso/vso.py b/sunpy/net/vso/vso.py
--- a/sunpy/net/vso/vso.py
+++ b/sunpy/net/vso/vso.py
@@ -617,7 +617,7 @@ def fetch(self, query_response, path=None, methods=None, site=None,
 
         fileids = VSOClient.by_fileid(query_response)
         if not fileids:
-            return downloader.download()
+            return downloader.download() if wait else Results()
         # Adding the site parameter to the info
         info = {}
         if site is not None:


Test patch:
diff --git a/sunpy/net/tests/test_vso.py b/sunpy/net/tests/test_vso.py
--- a/sunpy/net/tests/test_vso.py
+++ b/sunpy/net/tests/test_vso.py
@@ -3,6 +3,7 @@
 import pytest
 from unittest import mock
 import astropy.units as u
+from parfive import Results
 
 from sunpy.time import TimeRange, parse_time
 from sunpy.net import vso
@@ -268,6 +269,31 @@ def test_path(client, tmpdir):
     assert "aia_lev1_171a_2011_06_07t06_33_02_77z_image_lev1.fits" in files[0]
 
 
+@pytest.mark.remote_data
+def test_no_download(client):
+    """
+    Test for https://github.com/sunpy/sunpy/issues/3292
+    """
+    class MockDownloader:
+        download_called = False
+
+        def __init__(self):
+            pass
+
+        def download(self, *args, **kwargs):
+            download_called = True
+
+    # this should fail
+    stereo = (va.Detector('STEREO_B') &
+              va.Instrument('EUVI') &
+              va.Time('1900-01-01', '1900-01-01T00:10:00'))
+    qr = client.search(stereo)
+    downloader = MockDownloader()
+    res = client.fetch(qr, wait=False, downloader=downloader)
+    assert downloader.download_called is False
+    assert res == Results()
+
+
 def test_non_str_instrument():
     # Sanity Check
     assert isinstance(va.Instrument("lyra"), va.Instrument)