Tests use user configuration instead of default configuration

Issue #471 new
Joern Ungermann created an issue

The user defined configuration influences test cases and can introduce errors. In one example, the user configuration contained erroneous values for the vertical range of the side view that were introduced on an experimental branch. These causes the tests in the stable branch to fail later on.

Comments (6)

  1. Reimar Bauer

    the code base needs a review, usually

    export MSS_CONFIG_PATH="/tmp/tmp78h01gas/.config/mss"

    should be enough to set this path, but it is ignored.

    # set "MSS_CONFIG_PATH"
    
    os.environ["MSS_CONFIG_PATH"] = os.path.join(tempfile.mkdtemp(), ".config", "mss")
    

  2. Joern Ungermann reporter

    There is some code hidden away in mslib/_tests/constants.py that changes the environment for testing. That should prevent the user’s config from interfering with the tests. This seems to work on my laptop. Maybe you had a different error with the config?

    BTW, I do not think that the current solution is very robust. I think, this should be moved to conftest.py where it can be applied before importing any mslib code.

  3. Log in to comment