pytest dying on travis with a simple single test when collecting tests
See original GitHub issueI am seeing failures for a really simple test when running on travis - pytest seems to be being killed during the test collection phase. I have isolated down to running a single test file containing only one test:
import pytest
import sys
import lz4.block
@pytest.mark.skipif(sys.maxsize < 0xffffffff,
reason='Py_ssize_t too small for this test')
def test_huge():
try:
huge = b'\0' * 0x100000000 # warning: this allocates 4GB of memory!
except MemoryError:
pytest.skip('Insufficient system memory for this test')
On travis I see this:
$ pytest tests/block/test_block_2.py
============================= test session starts ==============================
platform linux -- Python 3.6.3, pytest-3.3.0, py-1.5.2, pluggy-0.6.0
rootdir: /home/travis/build/python-lz4/python-lz4, inifile: setup.cfg
collecting 0 items /home/travis/.travis/job_stages: line 57: 25059 Killed pytest tests/block/test_block_2.py
Unfortunately I can’t reproduce this locally, so I am at a bit of a loss as to what’s happening. Happy to provide more info if needed.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
How to pass Travis CI test for python click.version_option ...
For Travis, just add another command to the install section: ... You can even combine all three commands into one:
Read more >pytest Documentation - Read the Docs
Run tests by node ids. Each collected test is assigned a unique nodeid which consist of the module filename followed by specifiers like ......
Read more >Getting Started With Testing in Python
You can get started creating simple tests for your application in a few easy steps and then build on it from there. In...
Read more >Common Build Problems - Travis CI Docs
My tests broke but were working yesterday; My build script is killed without any error; My build fails unexpectedly; Segmentation faults from the...
Read more >pytest-deadfixtures - PyPI
A simple plugin to list unused fixtures in pytest. ... option will not run your tests and it's also sensible for errors in...
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
No worries at all, thank you for patiently working with me on IRC this afternoon to get to the bottom of it. I learnt a lot more about the python byte compilation process than I thought I’d ever need to know!
OK, so a quick summary in case anyone else hits this problem.
python tests/test_block_2.py
) resulted in the python process being killed (exit code 137). that removed pytest from the picture - I commented out the pytest stuff.Confirmed by having a simple file like this:
and locally running:
Shows that during byte compilation, 4GB of memory is used, even though the function isn’t actually called at any point.
So, I’ll close this, as this is a Python problem, not a pytest bug.