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

Do some test cleanup #952

Merged
merged 2 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 3 additions & 19 deletions test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@ def rc(tmp_path):
return rc


@pytest.fixture(scope='session')
def clear_integration_artifacts(request):
'''Fixture is session scoped to allow parallel runs without error
'''
if 'PYTEST_XDIST_WORKER' in os.environ:
# we never want to clean artifacts if running parallel tests
# because we cannot know when all processes are finished and it is
# safe to clean up
return

def rm_integration_artifacts():
path = "test/integration/artifacts"
if os.path.exists(path):
shutil.rmtree(path)

request.addfinalizer(rm_integration_artifacts)


class CompletedProcessProxy(object):

def __init__(self, result):
Expand Down Expand Up @@ -106,4 +88,6 @@ def project_fixtures(tmp_path):
dest = tmp_path / 'projects'
shutil.copytree(source, dest)

return dest
yield dest

shutil.rmtree(dest, ignore_errors=True)
2 changes: 0 additions & 2 deletions test/unit/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,3 @@ def test_stdout_file_no_write(rc, runner_mode):
for filename in ('stdout', 'stderr'):
stdout_path = Path(rc.artifact_dir) / filename
assert not stdout_path.exists()
assert list(runner.events)
assert 'hello_world_marker' in list(runner.events)[0]['stdout']