[BUG] 1.8.0: pytest is failing in 5 units
See original GitHub issueDescribe your issue.
Looks lik epytest is failing in few units.
Reproducing Code Example
I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
- `python3 -sBm build -w --no-isolation`
- because I'm calling `build` with `--no-isolation` I'm using during all processes only locally installed modules
- install .whl file in </install/prefix>
- run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
Error message
will include in next comment.
SciPy/NumPy/Python version information
scipy 1.8.0, python 3.8.13
Issue Analytics
- State:
- Created a year ago
- Comments:21 (12 by maintainers)
Top Results From Across the Web
Changelog — pytest documentation
Fixes a crash during a failed teardown in unittest TestCases with ... 2 values: E Index | Obtained | Expected E 1 |...
Read more >Lesson 16: Examples of TDD
To explore another feature of pytest , we'll consider another aspect of our number_negatives() function. Specifically, what should we do if an invalid...
Read more >Testing - Best practices in software engineering - milliams.com
In Python this "small unit of code" is usually a function. ... If we had five test functions in our file and three...
Read more >pytest-cov - PyPI
Pytest plugin for measuring coverage. ... Fix bug hiding test failure when cov-fail-under failed. For coverage >= 4.0, match the default behaviour of ......
Read more >Dibya Chakravorty - DataCamp
If function is buggy and does not raise ValueError , test will fail. Page 27. UNIT TESTING FOR DATA SCIENCE IN PYTHON. Testing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
$ python dev.py
or$ python runtests.py
from the scipy root. Or,$ pytest --pyargs scipy
to test already-installed version away from the repo root folder.The first failure is from a test using
subprocess.check_call([sys.executable, '-c', TEST_BODY])
. So it runs into exactly the failure mode you apparently already understand. The output really cannot be clearer:There’s only one way to get that output, which is running tests from the root of the repo. This is wrong, no matter how you invoke
pytest
; that invocation method does not carry over to the fresh process created bysubprocess.check_call
it looks like.Now it would be really nice if you actually confirmed that doing
cd ..
and rerunning the tests will make those failures go away. And by “really nice” I mean “you’re breaking open source etiquette by not even trying the solution that a maintainer has suggested to you”.