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

DOC: deprecated test syntax #23534

Open
Mikhaylov-yv opened this issue Apr 5, 2023 · 3 comments
Open

DOC: deprecated test syntax #23534

Mikhaylov-yv opened this issue Apr 5, 2023 · 3 comments

Comments

@Mikhaylov-yv
Copy link

Issue with current documentation:

Good afternoon.

I made a build of the source code from the main branch and ran the tests.
I got an error when specifying a test as a parameter --tests TESTS, -t TESTS
When executing this code:

python runtests.py -v -t numpy/core/tests/test_nditer.py

I get error: ERROR: module or package not found: numpy/core/tests/test_nditer.py (missing __init__.py?)

If I use which syntax

python runtests.py -v -t numpy.core.tests.test_nditer

Everything works correctly

In the documentation, including the file development_environment.rst, the first implementation option is indicated.

Runtime information:

>>> import sys, numpy; print(numpy.__version__); print(sys.version)
1.25.0.dev0+1062.g7f1ce595c
3.10.10 (main, Mar 23 2023, 17:28:09) [GCC 10.2.1 20210110]
>>> print(numpy.show_runtime())
WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build information
[{'numpy_version': '1.25.0.dev0+1062.g7f1ce595c',
  'python': '3.10.10 (main, Mar 23 2023, 17:28:09) [GCC 10.2.1 20210110]',
  'uname': uname_result(system='Linux', node='aa562c94224b', release='5.15.90.1-microsoft-standard-WSL2', version='#1 SMP Fri Jan 27 02:56:13 UTC 2023', machine='x86_64')},
 {'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
                      'found': ['SSSE3',
                                'SSE41',
                                'POPCNT',
                                'SSE42',
                                'AVX',
                                'F16C',
                                'FMA3',
                                'AVX2',
                                'AVX512F',
                                'AVX512CD',
                                'AVX512_SKX',
                                'AVX512_CLX',
                                'AVX512_CNL',
                                'AVX512_ICL'],
                      'not_found': ['AVX512_KNL', 'AVX512_KNM']}}]

If this documentation is outdated, I might update it.

Idea or request for content:

No response

@seberg
Copy link
Member

seberg commented Apr 6, 2023

Hmmm, runtests does a bit of a round-about invocation of via calling np.test(). Which looks like it ends up using ... --pyargs <test1> <test2>.

Probably pytest changed --pyargs to not accept the directory spelling anymore? I wonder if we should just tweak runtests to also accept paths if that really changed. OTOH, probably also OK to just document it and get used to the . spelling. (although I think pytest prints the test names as path making copy pasting harder then)

@Mikhaylov-yv
Copy link
Author

@seberg I agree with you. Specifying the test via the path looks more convenient than what we have now. I'll look in the history of the reasons for these changes.

@seberg
Copy link
Member

seberg commented Apr 6, 2023

There is a point that I think spin should replace runtests relatively soon, either way.

So rather than trying to hunt that down, that section should maybe just point to using spin instead:

spin test

(requires installing spin through conda-forge or pip of course)

I suspect spin calls pytest more directly anyway, so that paths work fine.

EDIT: IIRC, there may still be an issue that running tests in gdb is a bit harder due to subprocess use in spin right now. NVM, this is long fixed.

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

No branches or pull requests

2 participants