Skip to content

Commit

Permalink
Do some test cleanup (#952) (#980)
Browse files Browse the repository at this point in the history
[backport][release_2.0] Do some test cleanup (#952)

Backport of PR #952
(cherry picked from commit 0e451fc)

Reviewed-by: Alexander Sowitzki <dev@eqrx.net>
Reviewed-by: None <None>
  • Loading branch information
Shrews committed Jan 31, 2022
1 parent ebc432a commit ae74319
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions test/integration/conftest.py
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)

0 comments on commit ae74319

Please sign in to comment.