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

Tests should clean up after running #185

Open
donaldcampbelljr opened this issue Jun 12, 2023 · 3 comments
Open

Tests should clean up after running #185

donaldcampbelljr opened this issue Jun 12, 2023 · 3 comments

Comments

@donaldcampbelljr
Copy link
Member

Currently, it appears that tests for pypiper are generating results in a tmp directory that is not being cleaned up once pytesting is finished.

@nsheff
Copy link
Member

nsheff commented Jun 12, 2023

sounds like a good candidate for a context manager :)

@donaldcampbelljr
Copy link
Member Author

donaldcampbelljr commented Jun 14, 2023

Related, the unit test test_pipeline_manager.py is leaving 'failed' flag files after closing the test:
example: default_pipeline_name_sample_pipeline_failed.flag

However, they should be cleaned up via the function:

    OUTFOLDER = "tests/Data/pipeline_output"

    @classmethod
    def _clean(cls):
        for d in glob.glob(cls.OUTFOLDER + "*"):
            if os.path.isdir(d):
                print("Removing " + d)
                shutil.rmtree(d)

Also added status clearing at the very end of the unit test.

Next steps:
-Investigate using context manager

@vreuter
Copy link
Member

vreuter commented Aug 2, 2023

sounds like a good candidate for a context manager :)

Yes this and/or the tmp_path fixture from pytest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants