Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests files to tmp for user to have write access #2422

Closed
wants to merge 1 commit into from

Conversation

schopin-pro
Copy link

This relaxes the assumption that the filesystem is writeable. This patch
will be used on Ubuntu autopkgtest system, which runs tests on the
installed systems.

This relaxes the assumption that the filesystem is writeable. This patch
will be used on Ubuntu autopkgtest system, which runs tests on the
*installed* systems.
@codecov
Copy link

codecov bot commented May 31, 2022

Codecov Report

Merging #2422 (bbcf492) into main (be0938f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2422   +/-   ##
=======================================
  Coverage   62.97%   62.97%           
=======================================
  Files         133      133           
  Lines       17290    17290           
=======================================
  Hits        10888    10888           
  Misses       6402     6402           

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@eerovaher
Copy link
Member

This should address some of the instances listed in #2107, but would it be possible to use the pytest builtin tmp_path fixture instead of tempfile?

@bsipocz
Copy link
Member

bsipocz commented May 31, 2022

Using tempfile should be fine, most of the modules use that approach already. However, I'm afraid the patch doesn't fix the original issue (the failures are unrelated to this PR, but the files still show up in the repo):

$ ~/munka/devel/astroquery [test-tmpfile L|…1⚑ 16] $ git status
On branch test-tmpfile
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	notes/

nothing added to commit but untracked files present (use "git add" to track)
$ ~/munka/devel/astroquery [test-tmpfile L|…1⚑ 16] $ pytest -P esa.hubble --remote-data=any
================================================= test session starts ==================================================
platform darwin -- Python 3.10.0, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
WARNING: AstropyDeprecationWarning: The ignore_warnings class is deprecated and may be removed in a future version.
        Use pytest.mark.filterwarnings instead. [pytest_astropy_header.display]
WARNING: AstropyDeprecationWarning: The catch_warnings class is deprecated and may be removed in a future version.
        Use pytest.warns instead. [astropy.tests.helper]

Running tests with astroquery version 0.4.7.dev7854_testrun.
Running tests in /Users/bsipocz/munka/devel/astroquery.

Date: 2022-05-31T12:31:12
....

=============================================== short test summary info ================================================
FAILED astroquery/esa/hubble/tests/test_esa_hubble_remote.py::TestEsaHubbleRemoteData::test_cone_search - AssertionEr...
FAILED astroquery/esa/hubble/tests/test_esa_hubble_remote.py::TestEsaHubbleRemoteData::test_hap_simple_to_hap_composite
FAILED astroquery/esa/hubble/tests/test_esa_hubble_remote.py::TestEsaHubbleRemoteData::test_query_target - AssertionE...
======================================= 3 failed, 42 passed, 1 skipped in 31.66s =======================================

$ ~/munka/devel/astroquery [test-tmpfile L|…6⚑ 16] $ git status
On branch test-tmpfile
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	J6FL25S4Q.vot
	J6FL25S4Q.vot.fits.gz
	J6FL25S4Q.vot.jpg
	X0MC5101T.vot
	notes/
	w0ji0v01t_c2f.fits.gz

nothing added to commit but untracked files present (use "git add" to track)

@bsipocz
Copy link
Member

bsipocz commented Jul 20, 2022

I'm closing this as #2465 has addressed the issue for this module. Thank you @schopin-pro for the efforts you put into it and hope to see you around in astroquery!

@bsipocz bsipocz closed this Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants