datalad / datalad-next

DataLad extension for new functionality and improved user experience
https://datalad.org
Other
7 stars 8 forks source link

`pytest` now unintentional runtime dependency #698

Closed mih closed 4 months ago

mih commented 4 months ago

Look here: https://ci.debian.net/packages/d/datalad-next/testing/amd64/46884776/#S4

A plain import now requires pytest. This is due to the datalad-core patch fixing up some tests that was introduced with https://github.com/datalad/datalad-next/pull/669

This needs to be undone.

Ping @christian-monch for awareness.

aqw commented 4 months ago

It might be possible to guard the import of the patch to detect if pytest is running:

import os
if os.environ.get("PYTEST_VERSION") is not None:
    import pytest

Or alternatively sys._called_from_test.