Skip to content

Commit

Permalink
Update tmpdir usage to tmp_path and enable no:legacypath (#64)
Browse files Browse the repository at this point in the history
* enable no:legacypath pytest option

* add pyerfa dev to tox devdeps

* fix typo
  • Loading branch information
braingram authored Feb 29, 2024
1 parent 2fc02e8 commit 24e9024
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ci_watson/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ def pytest_runtest_setup(item):


@pytest.fixture(scope='function')
def _jail(tmpdir):
def _jail(tmp_path):
"""Perform test in a pristine temporary working directory."""
old_dir = os.getcwd()
os.chdir(tmpdir.strpath)
os.chdir(tmp_path)
try:
yield tmpdir.strpath
yield str(tmp_path)
finally:
os.chdir(old_dir)

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ junit_family = xunit2
filterwarnings =
error
ignore:numpy.ndarray size changed:RuntimeWarning
addopts = "-p no:legacypath"
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires =
passenv = HOME,CI

setenv =
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple https://pypi.anaconda.org/liberfa/simple

# tox environments are constructed with so-called 'factors' (or terms)
# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
Expand All @@ -33,6 +33,7 @@ extras =

deps =
devdeps: numpy>=0.0.dev0
devdeps: pyerfa>=0.0.dev0
devdeps: astropy>=0.0.dev0

commands =
Expand Down

0 comments on commit 24e9024

Please sign in to comment.