-
Notifications
You must be signed in to change notification settings - Fork 46
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 tests into tests directory #1698
Conversation
If you move the tests into |
My motivation is wanting to be able to find the tests easily without needing to use the UNIX |
63a829b
to
d0f8e96
Compare
Hmmm would seem there is a lot of weird crosstalk between tests (i.e. there are tests which are very not self-contained and imported bits of other tests from other folders e.g.
which weirdly does not cause test failure) |
Collection errors are errors, which are a separate category from test failures. Should still lead to failed builds on Azure |
Yes, I know I said we don't need those. But turns out that pytest really wants to be able to distinguish files, and if there are no __init__.py files at all then files are imported individually, and therefore you can't have two test files with the same name. This also means you only really need to add an __init__.py file if you get one of those import file mismatch: imported module 'test_XXX' has this __file__ attribute: ... which is not the same as the test file we want to collect: ... HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules errors.
minimal command to reproduce the issue:
|
This can throw off all sorts of things in other tests
Merge remote-tracking branch 'origin/main' into tests-move-directory
Codecov Report
@@ Coverage Diff @@
## main #1698 +/- ##
==========================================
- Coverage 67.13% 67.13% -0.01%
==========================================
Files 615 615
Lines 69053 69051 -2
Branches 9622 9622
==========================================
- Hits 46356 46354 -2
+ Misses 20765 20764 -1
- Partials 1932 1933 +1 |
But this PR is ready for merging. |
I've patched xfel_regression to refer to the new location in tst_ensemble_refinement.py. |
Thanks! |
Kept the structure the same as far as possible. Had to fix references in flight. I think all the tests should pass, will run regression tests in a mo.
Motivation: consistency