============================= test session starts ==============================
platform darwin -- Python 3.12.2, pytest-8.1.1, pluggy-1.4.0 -- /Users/petecheslock/repos/indico/venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/petecheslock/repos/indico
configfile: pytest.ini
plugins: snapshot-0.9.0, cov-5.0.0, indico-3.3.4.dev0, redis-3.0.2, anyio-4.3.0, appmap-2.1.4, mock-3.14.0, localserver-0.8.1
collecting ... collected 1 item
indico/modules/events/export_test.py::test_event_export FAILED [100%]
=================================== FAILURES ===================================
______________________________ test_event_export _______________________________
db = <IndicoSQLAlchemy postgresql:///test?host=%2Fvar%2Ffolders%2F2y%2Ft_jpbzqd07l4969l1523q2y40000gn%2FT%2Findicotestpg.bcr_yi8e>
dummy_event = <Event(0, 2017-08-24 10:00:00+00:00, 2017-08-24 12:00:00+00:00): "dummy#0">
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x11df6f800>
@pytest.mark.usefixtures('reproducible_uuids', 'static_indico_version')
def test_event_export(db, dummy_event, monkeypatch):
monkeypatch.setattr('indico.modules.events.export.now_utc', lambda: as_utc(datetime(2017, 8, 24, 9, 0, 0)))
f = BytesIO()
dummy_event.created_dt = as_utc(datetime(2017, 8, 24, 0, 0, 0))
dummy_event.start_dt = as_utc(datetime(2017, 8, 24, 10, 0, 0))
dummy_event.end_dt = as_utc(datetime(2017, 8, 24, 12, 0, 0))
s = Session(event=dummy_event, title='sd', is_deleted=True)
Contribution(event=dummy_event, title='c1', duration=timedelta(minutes=30))
Contribution(event=dummy_event, title='c2', session=s, duration=timedelta(minutes=30), is_deleted=True)
db.session.flush()
export_event(dummy_event, f)
f.seek(0)
data_yaml_content = (Path(__file__).parent / 'export_test_1.yaml').read_text()
# check composition of tarfile and data.yaml content
> with tarfile.open(fileobj=f) as tarf:
indico/modules/events/export_test.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'tarfile.TarFile'>, name = None, mode = 'r'
fileobj = <_io.BytesIO object at 0x11f210d10>, bufsize = 10240, kwargs = {}
not_compressed = <function TarFile.open.<locals>.not_compressed at 0x11efe98a0>
error_msgs = ["- method gz: ReadError('empty file')", "- method bz2: ReadError('not a bzip2 file')", "- method xz: ReadError('not an lzma file')", "- method tar: ReadError('empty file')"]
comptype = 'tar'
func = <bound method TarFile.taropen of <class 'tarfile.TarFile'>>
saved_pos = 0
error_msgs_summary = "- method gz: ReadError('empty file')\n- method bz2: ReadError('not a bzip2 file')\n- method xz: ReadError('not an lzma file')\n- method tar: ReadError('empty file')"
@classmethod
def open(cls, name=None, mode="r", fileobj=None, bufsize=RECORDSIZE, **kwargs):
"""Open a tar archive for reading, writing or appending. Return
an appropriate TarFile class.
mode:
'r' or 'r:*' open for reading with transparent compression
'r:' open for reading exclusively uncompressed
'r:gz' open for reading with gzip compression
'r:bz2' open for reading with bzip2 compression
'r:xz' open for reading with lzma compression
'a' or 'a:' open for appending, creating the file if necessary
'w' or 'w:' open for writing without compression
'w:gz' open for writing with gzip compression
'w:bz2' open for writing with bzip2 compression
'w:xz' open for writing with lzma compression
'x' or 'x:' create a tarfile exclusively without compression, raise
an exception if the file is already created
'x:gz' create a gzip compressed tarfile, raise an exception
if the file is already created
'x:bz2' create a bzip2 compressed tarfile, raise an exception
if the file is already created
'x:xz' create an lzma compressed tarfile, raise an exception
if the file is already created
'r|*' open a stream of tar blocks with transparent compression
'r|' open an uncompressed stream of tar blocks for reading
'r|gz' open a gzip compressed stream of tar blocks
'r|bz2' open a bzip2 compressed stream of tar blocks
'r|xz' open an lzma compressed stream of tar blocks
'w|' open an uncompressed stream for writing
'w|gz' open a gzip compressed stream for writing
'w|bz2' open a bzip2 compressed stream for writing
'w|xz' open an lzma compressed stream for writing
"""
if not name and not fileobj:
raise ValueError("nothing to open")
if mode in ("r", "r:*"):
# Find out which *open() is appropriate for opening the file.
def not_compressed(comptype):
return cls.OPEN_METH[comptype] == 'taropen'
error_msgs = []
for comptype in sorted(cls.OPEN_METH, key=not_compressed):
func = getattr(cls, cls.OPEN_METH[comptype])
if fileobj is not None:
saved_pos = fileobj.tell()
try:
return func(name, "r", fileobj, **kwargs)
except (ReadError, CompressionError) as e:
error_msgs.append(f'- method {comptype}: {e!r}')
if fileobj is not None:
fileobj.seek(saved_pos)
continue
error_msgs_summary = '\n'.join(error_msgs)
> raise ReadError(f"file could not be opened successfully:\n{error_msgs_summary}")
E tarfile.ReadError: file could not be opened successfully:
E - method gz: ReadError('empty file')
E - method bz2: ReadError('not a bzip2 file')
E - method xz: ReadError('not an lzma file')
E - method tar: ReadError('empty file')
../../.asdf/installs/python/3.12.2/lib/python3.12/tarfile.py:1809: ReadError
------------------------------ Captured log call -------------------------------
INFO _appmap.recording:recording.py:104 writing /Users/petecheslock/repos/indico/tmp/appmap/pytest/test_event_export.appmap.json
=========================== short test summary info ============================
FAILED indico/modules/events/export_test.py::test_event_export - tarfile.Read...
============================== 1 failed in 13.20s ==============================
Appmap library version
2.1.4Python
3.12.2Using the Indico fork mailnline branch
The following tests fail when using
appmap-python pytest -vv <path to test>indico/modules/events/export_test.py::test_event_export
indico/modules/events/export_test.py::test_event_attachment_export
indico/modules/events/papers/models/papers_test.py::test_can_judge
indico/util/i18n_test.py::test_lazy_translation