conftest.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import pytest
  2. import lz4.frame as lz4frame
  3. import lz4
  4. @pytest.fixture(
  5. params=[
  6. # (lz4frame.BLOCKSIZE_DEFAULT),
  7. (lz4frame.BLOCKSIZE_MAX64KB),
  8. (lz4frame.BLOCKSIZE_MAX256KB),
  9. (lz4frame.BLOCKSIZE_MAX1MB),
  10. (lz4frame.BLOCKSIZE_MAX4MB),
  11. ]
  12. )
  13. def block_size(request):
  14. return request.param
  15. @pytest.fixture(
  16. params=[
  17. (True),
  18. (False),
  19. ]
  20. )
  21. def block_linked(request):
  22. return request.param
  23. @pytest.fixture(
  24. params=[
  25. (True),
  26. (False),
  27. ]
  28. )
  29. def content_checksum(request):
  30. return request.param
  31. if lz4.library_version_number() >= 10800:
  32. p = [True, False]
  33. else:
  34. p = [False, ]
  35. @pytest.fixture(
  36. params=[
  37. (pp) for pp in p
  38. ]
  39. )
  40. def block_checksum(request):
  41. return request.param
  42. compression_levels = [
  43. (lz4frame.COMPRESSIONLEVEL_MIN),
  44. (lz4frame.COMPRESSIONLEVEL_MINHC),
  45. (lz4frame.COMPRESSIONLEVEL_MAX),
  46. ]
  47. @pytest.fixture(
  48. params=compression_levels
  49. )
  50. def compression_level(request):
  51. return request.param
  52. @pytest.fixture(
  53. params=[
  54. (True),
  55. (False)
  56. ]
  57. )
  58. def auto_flush(request):
  59. return request.param
  60. @pytest.fixture(
  61. params=[
  62. (True),
  63. (False)
  64. ]
  65. )
  66. def store_size(request):
  67. return request.param
  68. @pytest.fixture(
  69. params=[
  70. (True),
  71. (False),
  72. ]
  73. )
  74. def return_bytearray(request):
  75. return request.param