python-hyper / brotlicffi

Python bindings to the Brotli compression library
MIT License
147 stars 27 forks source link

conftest.py not included in sdist #148

Closed jayvdb closed 3 years ago

jayvdb commented 5 years ago

Running the tests from the sdist results in

[  138s] test/test_compatibility.py .                                             [  4%]
[  141s] test/test_simple_compression.py EEE..........                            [ 60%]
[  141s] test/test_simple_decompression.py EEE......                              [100%]
[  141s] 
[  141s] ==================================== ERRORS ====================================
[  141s] ___________ ERROR at setup of test_roundtrip_compression_with_files ____________
[  141s] file /home/abuild/rpmbuild/BUILD/brotlipy-0.7.0/test/test_simple_compression.py, line 16
[  141s]   def test_roundtrip_compression_with_files(simple_compressed_file):
[  141s] E       fixture 'simple_compressed_file' not found
[  141s] >       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
[  141s] >       use 'pytest --fixtures [testpath]' for help on them.
[  141s] 
[  141s] /home/abuild/rpmbuild/BUILD/brotlipy-0.7.0/test/test_simple_compression.py:16
jayvdb commented 5 years ago

Also the libbrotli/tests/testdata is not included. It is fairly large, so maybe not including it is a good thing, but the error message is currently

[  109s] ImportError while loading conftest '/home/abuild/rpmbuild/BUILD/brotlipy-0.7.0/test/conftest.py'.
[  109s] /usr/lib/python2.7/site-packages/six.py:709: in exec_
[  109s]     exec("""exec _code_ in _globs_, _locs_""")
[  109s] test/conftest.py:11: in <module>
[  109s]     os.path.join(TEST_DATA_DIR, p) for p in os.listdir(TEST_DATA_DIR)
[  109s] E   OSError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/brotlipy-0.7.0/libbrotli/tests/testdata'

That could be enhanced by indicating that the user should fetch the data separately, and give them the gitmodule sha which they should use to fetch the right test data for that release.

sethmlarson commented 3 years ago

Closed in https://github.com/python-hyper/brotlipy/pull/161