Skip to content

Commit

Permalink
pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Aug 17, 2019
1 parent 185dca3 commit 57d349c
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -108,7 +108,7 @@ jobs:
command: /opt/python/cp36-cp36m/bin/pip install --progress-bar off numpy==1.15.3 scipy astropy matplotlib==1.5.3
- run:
name: Install dependencies two
command: /opt/python/cp36-cp36m/bin/pip install --progress-bar off sqlalchemy scikit-image==0.13.1 glymur drms suds-jurko beautifulsoup4 requests python-dateutil pytest pytest-cov pytest-mock mock hypothesis pytest-astropy pytest-rerunfailures
command: /opt/python/cp36-cp36m/bin/pip install --progress-bar off sqlalchemy scikit-image==0.13.1 glymur drms suds-jurko beautifulsoup4 requests python-dateutil pytest<5.1 pytest-cov pytest-mock mock hypothesis pytest-astropy pytest-rerunfailures
- run:
name: Run tests
command: PYTHONHASHSEED=42 /opt/python/cp36-cp36m/bin/pytest
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/acquiring_data/hek.rst
Expand Up @@ -203,7 +203,7 @@ made by SSW Latest Events with the following command:

>>> result = client.search( hek.attrs.Time(tstart,tend), hek.attrs.EventType(event_type),hek.attrs.FRM.Name != 'SSW Latest Events') # doctest: +REMOTE_DATA
>>> len(result) # doctest: +REMOTE_DATA
17
19

We are using Python's comparison operators to filter the returns from
the HEK client. Other comparisons are possible. For example, let's
Expand Down
2 changes: 1 addition & 1 deletion docs/rtd_requirements.txt
@@ -1,7 +1,7 @@
# This file is used on ReadTheDocs to build the
# documentation and is separate of tox.ini and setup.cfg
numpy
pytest
pytest<5.1
astropy
scipy
pandas
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Expand Up @@ -5,7 +5,7 @@

hypothesis
mock
pytest
pytest<5.1
pytest-cov
pytest-mock
pytest-rerunfailures
Expand Down
56 changes: 53 additions & 3 deletions sunpy/database/tests/test_tables.py
Expand Up @@ -499,10 +499,60 @@ def test_entry_from_query_results_with_none_wave_and_default_unit(
observation_time_start=datetime(1996, 4, 11, 0, 0),
observation_time_end=datetime(2014, 3, 30, 23, 59),
instrument='VIRGO', size=32652.0, wavemin=None,
wavemax=None)]
wavemax=None),
DatabaseEntry(
source='SOHO', provider='SDAC', physobs='intensity',
fileid='/archive/soho/private/data/processed/virgo/level1/1212/DIARAD/121222_1.D01',
observation_time_start=datetime(2012, 12, 24, 0, 1, 58),
observation_time_end=datetime(2012, 12, 25, 0, 1, 57),
instrument='VIRGO', size=14.0, wavemin=None,
wavemax=None),
DatabaseEntry(
source='SOHO', provider='SDAC', physobs='intensity',
fileid='/archive/soho/private/data/processed/virgo/tsi_full/VIRGO_TSI_hourly.dat.tar.gz',
observation_time_start=datetime(1995, 12, 2, 0, 0),
observation_time_end=datetime(2020, 1, 1, 0, 0),
instrument='VIRGO', size=3072.0, wavemin=None,
wavemax=None),
DatabaseEntry(
source='SOHO', provider='SDAC', physobs='intensity',
fileid='/archive/soho/private/data/processed/virgo/tsi_full/VIRGO_TSI_daily.dat.tar.gz',
observation_time_start=datetime(1995, 12, 2, 0, 0),
observation_time_end=datetime(2020, 1, 1, 0, 0),
instrument='VIRGO', size=140.0, wavemin=None,
wavemax=None),
DatabaseEntry(
source='SOHO', provider='SDAC', physobs='intensity',
fileid='/archive/soho/private/data/processed/virgo/spm/VIRGO-SPM-BLUE-L2-MISSIONLONG.fits',
observation_time_start=datetime(1996, 1, 23, 0, 0),
observation_time_end=datetime(2019, 5, 5, 23, 59),
instrument='VIRGO', size=32652.0, wavemin=None,
wavemax=None),
DatabaseEntry(
source='SOHO', provider='SDAC', physobs='intensity',
fileid='/archive/soho/private/data/processed/virgo/spm/VIRGO-SPM-GREEN-L2-MISSIONLONG.fits',
observation_time_start=datetime(1996, 1, 23, 0, 0),
observation_time_end=datetime(2019, 5, 5, 23, 59),
instrument='VIRGO', size=32652.0, wavemin=None,
wavemax=None),
DatabaseEntry(
source='SOHO', provider='SDAC', physobs='intensity',
fileid='/archive/soho/private/data/processed/virgo/spm/VIRGO-SPM-RED-L2-MISSIONLONG.fits',
observation_time_start=datetime(1996, 1, 23, 0, 0),
observation_time_end=datetime(2019, 5, 5, 23, 59),
instrument='VIRGO', size=32652.0, wavemin=None,
wavemax=None),
DatabaseEntry(
source='SOHO', provider='SDAC', physobs='intensity',
fileid='/archive/soho/private/data/processed/virgo/sph/VIRGO_D4.2_SPH_960411_120914.tar.gz',
observation_time_start=datetime(1996, 4, 11, 0, 0),
observation_time_end=datetime(2012, 9, 14, 0, 0),
instrument='VIRGO', size=512000.0, wavemin=None,
wavemax=None)
]

for e in expected:
assert e in entries
for e in entries:
assert e in expected


def test_create_display_table_missing_entries():
Expand Down
3 changes: 1 addition & 2 deletions sunpy/net/tests/test_vso.py
Expand Up @@ -200,8 +200,7 @@ def test_wave_toangstrom():
with pytest.raises(u.UnitsError) as excinfo:
va.Wavelength(10 * u.g, 23 * u.g)
assert ('This unit is not convertable to any of [Unit("Angstrom"), Unit("kHz"), '
'Unit("keV")]' in str(excinfo))

'Unit("keV")]' in str(excinfo.value))

def test_time_xor():
one = va.Time((2010, 1, 1), (2010, 1, 2))
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -16,7 +16,7 @@ deps =
matplotlib
mock
pandas
pytest
pytest<5.1
pytest-astropy
pytest-cov
pytest-mock
Expand Down

0 comments on commit 57d349c

Please sign in to comment.