Skip to content

Meaning of dseqrecord ipython test #455

@manulera

Description

@manulera

Hi @BjornFJohansson,

This test is making some other new tests fail by reloading dseqrecord. Reloading the module means that isinstance fails when checking if something is a Dseqrecord as it is comparing the previous class with the reloaded class. What does it test and could it be tested in a way that does not do this?
Otherwise I can just make it reload the affected module again.

def test_IPython_missing(monkeypatch):
import IPython
from pydna import dseqrecord
# assert dseqrecord._display is IPython.display.display
assert dseqrecord._display_html == IPython.display.display_html
import sys
import copy
fakesysmodules = copy.copy(sys.modules)
fakesysmodules["IPython.display"] = None
monkeypatch.delitem(sys.modules, "IPython.display")
monkeypatch.setattr("sys.modules", fakesysmodules)
from importlib import reload
reload(dseqrecord)
from pydna import dseqrecord
assert dseqrecord._display_html("item") == "item"
# assert dseqrecord._HTML("item") == "item"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions