Skip to content

Error running tests.sh on Ubuntu 20.04.06 LTS #5

@hbonnavaud

Description

@hbonnavaud

While running test I have two tests failure :
============================================================================= short test summary info =============================================================================
FAILED tests/test_mazeexplorer.py::test_generate_video - FileNotFoundError: The directory '/tmp/pytest-of-user/pytest-22/test_generate_video0/record' does not exist
FAILED tests/test_mazeexplorer.py::test_generate_with_seed - assert 1 == 10

I investigate the first error and found the reason, in MazeExplorer/mazeexplorer/mazeexplorer.py line 85 and 86:
shutil.rmtree(self.mazes_path, ignore_errors=True)
os.mkdir(self.mazes_path)

In the test called "tests/test_mazeexplorer.py::test_generate_video", at these lines self.mazes_path = '/tmp/pytest-of-user/pytest-22/test_generate_video0/'. Before to create the env, the sub directory 'record' is created :
test_mazeexplorer.py lines 58/59
record_path = tmpdir.mkdir("record")
env = MazeExplorer(mazes_path=tmpdir.strpath)

But calling "shutil.rmtree" on tmpdir.strpath then re-create "tmpdir.strpath" in the MazeExplorer class obviously remove the previously created sub directory 'record', so trying to store a video inside it raise an error.

I don't goes deeper in the second one ...

Are these tests important to use the code ? Can you fix it in the repository ? Because I don't think the first one can pass on any machine...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions