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

Move pytket/tests directory elsewhere #995

Open
cqc-alec opened this issue Aug 31, 2023 · 2 comments
Open

Move pytket/tests directory elsewhere #995

cqc-alec opened this issue Aug 31, 2023 · 2 comments
Labels

Comments

@cqc-alec
Copy link
Collaborator

See this comment.

@trvto
Copy link
Contributor

trvto commented Sep 4, 2023

In that comment, I missed a "note" from pytest documentation: https://docs.pytest.org/en/6.2.x/goodpractices.html

Note
The new --import-mode=importlib (see Import modes) doesn’t have any of the drawbacks above because sys.path and sys.modules are not changed when importing test modules, so users that run into this issue are strongly encouraged to try it and report if the new option works well for them.

The src directory layout is still strongly recommended however.

So, I think instead of moving pytket/tests in order to achieve what I wanted, we could just make the tests directory into a package and use --import-mode=importlib to avoid the problems I was seeing. According to https://docs.pytest.org/en/6.2.x/pythonpath.html#import-modes, pytest intends to make --import-mode=importlib the default at some point.

Copy link

github-actions bot commented Jun 9, 2024

This issue has been automatically marked as stale.

@github-actions github-actions bot added the stale label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants