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

get_data_type_manager.get_separator() seems to return the same separator instance other than a new instance #88

Open
hxin opened this issue Dec 1, 2018 · 0 comments

Comments

@hxin
Copy link
Collaborator

hxin commented Dec 1, 2018

I was refactoring the teat code to work with the changes in dev branch when I notice a wired error:

I have a test file containing two tests:
test_run_chipseq_se_makefile
test_run_chipseq_pe_makefile

When running then individually, no error occurred.

pytest  --log-cli-level debug  tests/separator/test_separator.py::test_run_chipseq_se_makefile
pytest  --log-cli-level debug  tests/separator/test_separator.py::test_run_chipseq_pe_makefile

However, when running them together, it seems that the Makefile generated by the second test contains the content of the first Makefile.

 pytest  --log-cli-level debug  tests/separator/test_separator.py

After debugging a bit, it seems that, for some reason, when running the test together, the second _DATA_TYPES is the same instance as the first one. Thus the returned DnaSeqMakefileWriter is the same instance of the first one, resulting in the DnaSeqMakefileWriter.lines variable already contains the first makefile content.

This may due to the face that the _DATA_TYPES is a variable in the file, rather than in a class/instance. I am not sure if this is a bug really but just a python variable scope thing I didn't understand well. Maybe we can chat about this when meet.

@lweasel

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

1 participant