Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve unittests / fix unittest failures #29

Closed
ischoegl opened this issue Dec 3, 2020 · 1 comment
Closed

Improve unittests / fix unittest failures #29

ischoegl opened this issue Dec 3, 2020 · 1 comment
Assignees

Comments

@ischoegl
Copy link
Collaborator

ischoegl commented Dec 3, 2020

Unittests should probably check whether content is saved correctly (rather than just perform some rudimentary checks).

On linux there are currently two unittest failures:

_________________________________________________________________ TestWrap.test_commandline __________________________________________________________________

self = <test_ctwrap.TestWrap testMethod=test_commandline>

    def test_commandline(self):
        cmd = 'ctwrap'
        name = self._module.__name__.split('.')[-1]
        yaml = "{}".format(Path(EXAMPLES) / self._yaml)
        pars = [name, yaml, '--parallel']
    
        self.maxDiff = None
        process = subprocess.Popen([cmd] + pars,
                     stdout=subprocess.PIPE,
                     stderr=subprocess.PIPE)
        _, stderr = process.communicate()
>       self.assertEqual(stderr.decode(), '')
E       AssertionError: 'Process Process-5:\nTraceback (most recen[518 chars]nt\n' != ''
E       - Process Process-5:
E       - Traceback (most recent call last):
E       -   File "/home/ischoegl/.pyenv/versions/miniconda3-latest/envs/ctwrap/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
E       -     self.run()
E       -   File "/home/ischoegl/.pyenv/versions/miniconda3-latest/envs/ctwrap/lib/python3.7/multiprocessing/process.py", line 99, in run
E       -     self._target(*self._args, **self._kwargs)
E       -   File "/work/GitHub/ctwrap/ctwrap/simulation.py", line 586, in worker
E       -     obj._save_metadata(metadata)
E       - UnboundLocalError: local variable 'obj' referenced before assignment

tests/test_ctwrap.py:85: AssertionError

and a related one in TestIgnition.test_commandline.

@ischoegl ischoegl mentioned this issue Dec 3, 2020
19 tasks
@ischoegl ischoegl changed the title Fix unittest failures Improve unittests / fix unittest failures Dec 3, 2020
@ischoegl ischoegl self-assigned this Dec 3, 2020
@ischoegl
Copy link
Collaborator Author

Superseded by #32 - the issue above still pops up on a Linux machine (Fedora FC32).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants