python-hyper / hpack

HTTP/2 Header Encoding for Python
https://hpack.readthedocs.io/en/latest/
MIT License
72 stars 32 forks source link

sdist is missing test/test_fixtures #272

Open mtelka opened 11 months ago

mtelka commented 11 months ago

The sdist package at PyPI is missing test/test_fixtures. Without test/test_fixtures testing fails. Please add the missing directory to sdist. Thank you.

Kriechi commented 11 months ago

We actually explicitly removed them some time ago, including the integration tests: https://github.com/python-hyper/hpack/commit/09dcf5a695266c35ff594605e79f472f224e7b7f

Which tests do you see failing?

mtelka commented 11 months ago

Testing is unable to start at all when started via tox:

py39: commands[0]> pytest --cov-report=xml --cov-report=term --cov=hpack
ImportError while loading conftest '$(BUILD_DIR)/test/conftest.py'.
test/conftest.py:19: in <module>
    for d in os.listdir('test/test_fixtures')
E   FileNotFoundError: [Errno 2] No such file or directory: 'test/test_fixtures'
Kriechi commented 11 months ago

Thanks - I think this makes sense. We removed the test file itself (https://github.com/python-hyper/hpack/blob/master/MANIFEST.in#L9), but not the conftest which configures the fixtures and tests.

Please delete the conftest.py and try again. All other tests should now run cleanly. If this works, we can add this exclusion to the manifest as well.

mtelka commented 11 months ago

With the conftest.py file removed all regular tests pass, but coverage fails:

Name                                                            Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------------------------------------------
/usr/lib/python3.9/vendor-packages/hpack/__init__.py                6      0      0      0   100%
/usr/lib/python3.9/vendor-packages/hpack/exceptions.py             11      0      0      0   100%
/usr/lib/python3.9/vendor-packages/hpack/hpack.py                 246      0     88      0   100%
/usr/lib/python3.9/vendor-packages/hpack/huffman.py                27      3      6      2    85%   27, 63-64
/usr/lib/python3.9/vendor-packages/hpack/huffman_constants.py       3      0      0      0   100%
/usr/lib/python3.9/vendor-packages/hpack/huffman_table.py          29      0     14      0   100%
/usr/lib/python3.9/vendor-packages/hpack/struct.py                  9      0      0      0   100%
/usr/lib/python3.9/vendor-packages/hpack/table.py                  80      0     28      1    99%   188->184
-----------------------------------------------------------------------------------------------------------
TOTAL                                                             411      3    136      3    99%
Coverage XML written to file coverage.xml

FAIL Required test coverage of 100.0% not reached. Total coverage: 98.90%