Skip to content

Commit 518e5ea

Browse files
committed
MAINT: remove duplicated conftest
1 parent bd29471 commit 518e5ea

File tree

2 files changed

+30
-80
lines changed

2 files changed

+30
-80
lines changed

astroquery/conftest.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

conftest.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22

3-
import numpy as np
4-
from astropy.utils import minversion
3+
import os
4+
from pathlib import Path
55

6+
from astropy.utils import minversion
7+
import numpy as np
8+
import pytest
69
from pytest_astropy_header.display import (PYTEST_HEADER_MODULES,
710
TESTED_VERSIONS)
811

@@ -22,6 +25,10 @@ def pytest_configure(config):
2225
PYTEST_HEADER_MODULES['astropy-healpix'] = 'astropy_healpix'
2326
PYTEST_HEADER_MODULES['vamdclib'] = 'vamdclib'
2427

28+
del PYTEST_HEADER_MODULES['h5py']
29+
del PYTEST_HEADER_MODULES['Scipy']
30+
del PYTEST_HEADER_MODULES['Pandas']
31+
2532
# keyring doesn't provide __version__ any more
2633
# PYTEST_HEADER_MODULES['keyring'] = 'keyring'
2734

@@ -32,3 +39,24 @@ def pytest_configure(config):
3239

3340
TESTED_VERSIONS['astroquery'] = version.version
3441
TESTED_VERSIONS['astropy_helpers'] = version.astropy_helpers_version
42+
43+
44+
def pytest_addoption(parser):
45+
parser.addoption(
46+
'--alma-site',
47+
action='store',
48+
default='almascience.eso.org',
49+
help='ALMA site (almascience.nrao.edu, almascience.eso.org or '
50+
'almascience.nao.ac.jp for example)'
51+
)
52+
53+
54+
@pytest.fixture(scope='function')
55+
def tmp_cwd(tmp_path):
56+
"""Perform test in a pristine temporary working directory."""
57+
old_dir = Path.cwd()
58+
os.chdir(tmp_path)
59+
try:
60+
yield tmp_path
61+
finally:
62+
os.chdir(old_dir)

0 commit comments

Comments
 (0)