Skip to content

Commit

Permalink
Revert test hacking
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Mar 27, 2023
1 parent ca510de commit 0bef28a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
5 changes: 1 addition & 4 deletions parsl/tests/test_bash_apps/test_error_codes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import argparse
import logging
import os

import pytest
Expand All @@ -13,8 +12,6 @@

from parsl.tests.configs.local_threads import fresh_config as local_config

logger = logging.getLogger(__name__)


@bash_app
def command_not_found(stderr='std.err', stdout='std.out'):
Expand Down Expand Up @@ -74,7 +71,7 @@ def test_div_0(test_fn=div_0):
assert e.exitcode == err_code, "{0} expected err_code:{1} but got {2}".format(test_fn.__name__,
err_code,
e.exitcode)
logger.info(f"Current directory listing: {os.listdir('.')}")
print(os.listdir('.'))
os.remove('std.err')
os.remove('std.out')
return True
Expand Down
17 changes: 5 additions & 12 deletions parsl/tests/test_docs/test_from_slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
from parsl.data_provider.files import File

import os
import pytest


@bash_app
def echo(message, outputs=[]):
return 'pwd > /tmp/xx2; echo {o} >> /tmp/xx2 ; echo {m} &> {o}'.format(m=message, o=outputs[0])
return 'echo {m} &> {o}'.format(m=message, o=outputs[0])


@python_app
Expand All @@ -19,19 +18,13 @@ def cat(inputs=[]):
def test_slides():
"""Testing code snippet from slides """

input_message = "Hello World!"

if os.path.exists('hello1.txt'):
os.remove('hello1.txt')

hello = echo(input_message, outputs=[File('hello1.txt')])
hello = echo("Hello World!", outputs=[File('hello1.txt')])

message = cat(inputs=[hello.outputs[0]])

assert hello.exception() is None

# this should exist as soon as hello is finished
assert os.path.exists('hello1.txt')

assert len(message.result()) == 1
assert message.result()[0].strip() == input_message
# Waits. This need not be in the slides.
print(hello.result())
print(message.result())

0 comments on commit 0bef28a

Please sign in to comment.