-
Notifications
You must be signed in to change notification settings - Fork 195
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
Remove some local-dev test detritus #3393
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import copy | ||
import os | ||
from typing import List | ||
|
||
import pytest | ||
|
@@ -30,21 +29,17 @@ def no_checkpoint_stdout_app(stdout=None): | |
return "echo X" | ||
|
||
|
||
def test_memo_stdout(): | ||
|
||
def test_memo_stdout(tmpd_cwd): | ||
assert const_list_x == const_list_x_arg | ||
|
||
path_x = "test.memo.stdout.x" | ||
if os.path.exists(path_x): | ||
os.remove(path_x) | ||
path_x = tmpd_cwd / "test.memo.stdout.x" | ||
|
||
# this should run and create a file named after path_x | ||
no_checkpoint_stdout_app(stdout=path_x).result() | ||
assert os.path.exists(path_x) | ||
no_checkpoint_stdout_app(stdout=str(path_x)).result() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recent work should have this still work with path_x being an os.PathLike, which I think is the case here - for example, see the monitoring tests in parsl/tests/test_monitoring/test_stdouterr.py (although those tests only check that the path goes through to monitoring correctly - not that the path really is used by the executing app) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (i.e. this |
||
path_x.unlink(missing_ok=False) | ||
|
||
os.remove(path_x) | ||
no_checkpoint_stdout_app(stdout=path_x).result() | ||
assert not os.path.exists(path_x) | ||
no_checkpoint_stdout_app(stdout=str(path_x)).result() | ||
assert not path_x.exists(), "For memoization, expected NO file written" | ||
|
||
# this should also be memoized, so not create an arbitrary name | ||
z_fut = no_checkpoint_stdout_app(stdout=parsl.AUTO_LOGNAME) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,11 +22,11 @@ def test_files(): | |
|
||
|
||
@pytest.mark.local | ||
def test_open(): | ||
with open('test-open.txt', 'w') as tfile: | ||
tfile.write('Hello') | ||
def test_open(tmpd_cwd): | ||
fpath = tmpd_cwd / 'test-open.txt' | ||
fpath.write_text('Hello') | ||
|
||
pfile = File('test-open.txt') | ||
pfile = File(fpath) | ||
|
||
with open(str(pfile), 'r') as opfile: | ||
assert (opfile.readlines()[0] == 'Hello') | ||
with open(pfile) as opfile: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is changing what's being tested: before, it tested that whatever a File returned as its That So maybe this should be testing both behaviours? |
||
assert (opfile.read() == 'Hello') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see other comment about hopefully-redundant
str